Reference Intersector cannot catch element with only lines or curves

Reference Intersector cannot catch element with only lines or curves

zhuliyi0
Enthusiast Enthusiast
501 Views
4 Replies
Message 1 of 5

Reference Intersector cannot catch element with only lines or curves

zhuliyi0
Enthusiast
Enthusiast

I am aware this discussion has happened in another post. Seems like intersctor only works with face. Then how can I find things that only has line or curve, such as a model line, or a directshape containing a line?

0 Likes
502 Views
4 Replies
Replies (4)
Message 2 of 5

zhuliyi0
Enthusiast
Enthusiast

To be specific, what I want to achieve is something similar to Selection.PickPoint, without actually using that method, because I need to do some other thing that cannot be done with that method simutaniously, like displaying something with DirectContext3D. I can do this with element with face, using intersector. I wish I can do the same with element without face.

0 Likes
Message 3 of 5

RPTHOMAS108
Mentor
Mentor

DirectContext3D is done as external server could be running continuously and isn't that then independent of UI method PickPoint? So I don't understand the stated conflict of those API features?

 

I recall finding model curves with the ReferenceIntersector in the past but usually when not expecting them i.e. they are model elements but unlikely that a zero thickness ray will hit a zero thickness geometric line.

 

PickPoint alternative could be used in conjunction with either Curve.Distance or Curve.Project for all curves collected in the current view. Using tolerance to decide if the distance between a picked point and the nearest point to that on a curve means the curve was picked.

 

However PickObject/s with ObjectType.Edge seems the most straightforward option.

0 Likes
Message 4 of 5

zhuliyi0
Enthusiast
Enthusiast

Sorry I didn't frame my question well. About DC3D, I am aware that it is independent of UI and API context except for register and unregister servers. The limitations are more about .PickPoint method. First, I don't want the constrain of first select a workplane, then pick a point on that work plane. I want the user to freely pick a point in 3D space. A second limitation of .PickPoint is that it only supports one snap type, but I need to use multiple snap types at once.

 

So I went for those goals without using .PickPoint or other .Pick methods. I made it work using DC3D and intersector, but only with geometries with faces.

0 Likes
Message 5 of 5

zhuliyi0
Enthusiast
Enthusiast

About using .PickObject with ObjectType.Edge: yes it will give me a point and I could use it to search for nearest snap point. However, it does not allow interactively showing that snap point to the user while inside .PickObject method, because .GlobalPoint is returned after the method is finished. Plus, .ObjectType.Edge does not support geometry without face, like model lines.

0 Likes