IntersectWithCurve Consistence issue

IntersectWithCurve Consistence issue

yan.gauthier
Advocate Advocate
407 Views
1 Reply
Message 1 of 2

IntersectWithCurve Consistence issue

yan.gauthier
Advocate
Advocate

Hi,

 

This is a part of a function i developped based on the ray casting algorithm. The problem is that with some drawingcurves, the intersection does not always work. Is there something missing or is it a bug ? I am lost right now

 

 

Dim oPoint As Point2d
Dim EndPoint As Point2d
Dim invapp As Inventor.Application
Dim Oline As LineSegment2d
Dim InvTG As TransientGeometry
Dim oView As DrawingView
Dim oDrawingCurve As DrawingCurve
Dim i As Integer


Set invapp = GetObject(, "Inventor.Application")
Set InvTG = invapp.TransientGeometry
Set oView = oCurve.Parent

Set EndPoint = InvTG.CreatePoint2d(oView.Left + oView.Width + 10, oCurve.CenterPoint.y)
Set Oline = InvTG.CreateLineSegment2d(oCurve.CenterPoint, EndPoint)

'loop through all intersection For i = 1 To oCurves.Count Set oDrawingCurve = oCurves.Curve(i).Curve If oDrawingCurve.EdgeType = kUnknownEdge Then If Not Oline.IntersectWithCurve(oDrawingCurve.Segments.item(1).Geometry) Is Nothing Then For Each oPoint In Oline.IntersectWithCurve(oDrawingCurve.Segments.item(1).Geometry) 'do something Next oPoint End If End If Next i

 Here's a representation of the oLine. When comparing with the right fillet curve, it does not detect an intersection.

 

RayCast.png

0 Likes
408 Views
1 Reply
Reply (1)
Message 2 of 2

yan.gauthier
Advocate
Advocate
Could someone try and see if it works ? if i rotate my view, it works, but not with this orientation...

Just disregard my custom object oCurve et get all your drawing curves using draqingview.drawingcurves method

Thanks
0 Likes