Message 1 of 2
IntersectWithCurve Consistence issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.