Jozi68 发表于 2022-7-6 12:53:46

VB.NET: Lines crossing Polylin

Hi All,
I work in 2D.I need to write a small VB.net app, where the user selects a polyline. That I can do.
Now I need to give a list of coordinates on this Polyline, where perpendicular lines intersect with the polyline.Any ideas?

SEANT 发表于 2022-7-6 14:04:38

I don’t think there is any direct method call.The only option may be a systematic (For Each) testing all the other lines (hopefully a highly filtered selection set for speed of processing) in the drawing for an intersection (IntersectWith) with the poly in question.
 
If an intersection is found, the routine would then have to test if the line is perpendicular to that segment of the poly (Vector2d.IsPerpendicularTo and/or, if the pertinent poly section is an arc, Curve.GetFirstDerivative perhaps).If so, add the Point3D returned by IntersectWith to a Point3dCollection.
 
All in all not the toughest of tasks; would probably take a bit of time to debug and optimize, however.
页: [1]
查看完整版本: VB.NET: Lines crossing Polylin