Is curve closed?

   2624   6   0
User Avatar
Member
17 posts
Joined: Nov. 2018
Offline
Is there a way to analyze whether a curve is closed or not and convert the yes / no to a Boolean?
Edited by BenWWilson - Nov. 10, 2022 16:11:24
User Avatar
Member
5042 posts
Joined: Feb. 2012
Offline
Hi,

You can get the prim intrinsic "closed":

i@isclosed = primintrinsic ( 0, "closed", @primnum );
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
17 posts
Joined: Nov. 2018
Offline
That's what I needed, thanks very much.

Just for anyone after this:
-plug the curve into a primitive attribute wrangle
-paste animatrix_ expression in VEXpression field
-check geometry spreadsheet primitive tab
-you'll see a 0 or 1 value depending on whether it's open or closed
User Avatar
Staff
443 posts
Joined: Feb. 2008
Offline
If you just want to see whether the curve is closed or not, in the geometry spreadsheet you can display intrinsics, no need to create a new attribute.

You can also directly access that intrinsic in group fields. For example, put down a blast node and set the group parm to
@intrinsic:closed=1
to delete all closed curves.

Attachments:
intrinsics.jpg (674.4 KB)

User Avatar
Member
17 posts
Joined: Nov. 2018
Offline
Even better, if I wanted to take that 0 or 1 and have it control the "closed" tick box on the add node, how would I go about that?

Is it possible to paste that as a reference?
User Avatar
Staff
443 posts
Joined: Feb. 2008
Offline
I'm not sure what you're trying to do with the add node, but you can certainly lookup a prim's "closed" intrinsic value using the prim(...) expression, such as
prim(<PATH TO NODE>, <PRIM NUMBER>, "intrinsic:closed", 0)
User Avatar
Member
17 posts
Joined: Nov. 2018
Offline
-electric fence
-curve to set path
-add node to create connecting wires
-if path curve is open I want to untick closed on the add node, if path curve is closed i want to tick closed on the add node
  • Quick Links