Selective plane/geometry orientation issue [Resolved!]

unhandled

#1

Hi GH/Rhino community,

I’ve run into a problem concerning the ‘inverting’ or flipping of a plane as a result of the referenced line changing direction. This line is a ClosestPoint line between two curves which inflects as the curves cross over.

It is of course highly logical that a plane (and the geometry that lies upon it) would do so, considering the changing state of the referenced line (a vector?).

However, I wish to be more selective/scrutinising of the orientation of the constructed plane, using that same line as a perpendicular reference.

Specifically, I’m looking for a way to construct a plane which references the line in question but merely does so for the purpose of remaining perpendicular to it. From here it seems logical that another series of conditional statements are used to keep the plane and geometry pointing “up” - but how that’s done, I do not know!!!

I’ve tried a number of things to resolve this but now I’m properly stuck.

Attached are images (and GH file) which I hope will better articulate the issue I’m having.

SystemLogic_ClosestPoint_270418.gh (31.8 KB)

Also! The script features I think this issue concerns are found at the far right of the GH canvas and are highlighted in green. I’ll make it my mission this afternoon to do a much cleaner job of internalising the data.

Questions and suggestions are greatly welcomed and appreciated!

Regards,
Brad


(qythium) #3

Try using the Horizontal Frame(s) or Perpendicular Frame(s) components instead of constructing normal planes from the curve’s tangents.


#4

It seems I’ve found the answer!

@qythium I considered using both of those components (particularly the Perp Frames) but they simply weren’t suitable for the more practical side of my script’s purpose. I appreciate your suggestions however!

Anyhow, I’ve found a suitable workaround which involves the “Curve Side” component. This component produces a number (-1 or +1) which affirms on which side of the target curve the point (or in my case, a “Closest Point” line) resides.

Points which return a -1 value reside below the curve, and those with a +1 reside above the curve.

Using a Remap component, -1 values would be transposed to a value of 180 - the number of degrees required to rotate the plane/geometry to the desired position!

Those returning a +1 would be transposed to a value of 0 - no rotation of the plane/geometry.

I apologise for the particularly convoluted script in the original post. Below is a much simpler script and illustration of my workaround.

Plane_Rotation Logic.gh (28.8 KB)