Skip to content

I want to achieve an effect where, as the mouse moves on the screen, the nearest corresponding point on the model can always be found. #7172

Answered by bbastings
MYDJH asked this question in Q&A
Discussion options

You must be logged in to vote

TransitionSpiral is just another sub-class of CurvePrimitive, as is Arc3d, LineSegment3d, etc. Use GeometryStreamIterator to get all curve geometry as a CurvePrimitive and call the closestPoint method.

You don't need to create the CurvePrimitive sub-classes like LineSegment3d/Arc3d directly yourself, the iterator already did that for you and returned them as the base geometry class for curves, surfaces, and solids: GeometryQuery.

You can use GeometryQuery.geometryCategory to test if the geometry is represented by a CurvePrimitive. Then use CurvePrimitive.curvePrimitiveType to test for specific sub-classes and use instanceof if you need to want/need to call class specific methods.

If you j…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MYDJH
Comment options

Answer selected by MYDJH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants