Wire inside another wire

Technical discussions
Post Reply
eVoodoo
Posts: 2
Joined: Wed May 27, 2020 4:09 am

Wire inside another wire

Post by eVoodoo »

Hello

I am totally new to dgk and i am trying to solve the following problem. I have two wires that I know definitely are cyclic and are parallel to z axis. I want to check if the one of the wires is inside the other. How can i do that?

Prashant Kande
Posts: 62
Joined: Mon Apr 04, 2016 4:55 am

Re: Wire inside another wire

Post by Prashant Kande »

Hello eVoodoo

Sorry, currently we do not have it on level of wires. I suggest getting all curves from the wires and using
ICurve_DG.GetPointLocation().

Via IBRepWire_DG.GetEdge() > IBRepEdge_DG.GetCurve()

Think about adding something like WireGetPointLocation(IBRepWire_DG wire, DgPoint point) or WireGetCurveLocation(IBRepWire_DG wire, ICurve_DG curve) in your code.

We are planning to add a high level way to do things like that in minor versions of v6

Regards

eVoodoo
Posts: 2
Joined: Wed May 27, 2020 4:09 am

Re: Wire inside another wire

Post by eVoodoo »

Thank you, Prashant
but where the points should come from for ICurve_DG.GetPointLocation()?

Prashant Kande
Posts: 62
Joined: Mon Apr 04, 2016 4:55 am

Re: Wire inside another wire

Post by Prashant Kande »

Sample the curves using ICurve_DG.GetPointAtRatio(double ratio) at a number of positions (in 0 to 1.0 range). How many? - I guess 10 would be plenty, but it is better to take it larger like 60 and tune in to reduce until you start getting wrong answers.

Post Reply