this simple test has concentric arcs and the lines happen to pass through the center
the arcs may not always be concentric, the lines not always radial
trying to generalize the problem so it would fit with any(within reason) conditions
the arcs may not always lay more or less horizontal, though i could add that as a condition for the user to always adjust them that way if need be....
i'm fine with replacing with new objects
but i still have to know where those objects go(startpoint,endpoint,angle, whatever)
i'm sorry to be so dense, but i'm not seeing how i have less to figure out by creating new objects versus editing existing ones.
i wish i was smarter
🙂
If you're not subject to the concenric/radial constraint, the problem
becomes more difficult because the arcs could intersect, and have
coincident endpoints with the lines.
I don't know if I can help with a more-or-less complete reinvention
of the FILLET command, because that is simply not trivial given all
of the possible conditions.
the arcs will never intersect each other
the arcs and lines will not start out with coincident points since they are the result of offsetting the original arcs and lines by some distance.
it is the new coincident points i'm needing to calculate.
I agree it's not seeming trivial in my mind, i just wanted to make sure that was true and not just me not seeing the simple obvious method. (i have a tendency to overcomplicate things)
if i could figure out how to use your commandline class that might make it easier
i've looked at it a bit and the example supplied by the other poster where he was picking the entities
in my case i already have them but i have to learn how to convert his code from api to com or learn how to incorporate api into my com project.
not that anyone cares but fwiw...
this is probably full of holes, but it seems to work on my first test dwg
this is just to find which of the multiple intersections returned by .IntersectWith are the "actual" intersections(closest)
Private Function GetClosestIntersectionToOrigArc(ByVal ListOfPoints As Object, ByVal oarc As AcadArc) As Double()
Dim Testpoint As Point3d
Dim NewPointList() As Double
Dim NewStartPoint(0 To 2) As Double
Dim arcstart As Point3d = New Point3d(oarc.StartPoint)
Dim arcEnd As Point3d = New Point3d(oarc.EndPoint)
NewPointList = CType(ListOfPoints, Double())
'because IntersectWith can return multiple intersections we have to find which is closest to original arc
'it's either closest to arcstart or arcend
Dim i As Short
Dim colPoints As New Collection
Dim testIntersection As Point3d
'if the array isn't multiple of 3 we're hosed
For i = 0 To UBound(NewPointList) Step 3
testIntersection = New Point3d(NewPointList(i), NewPointList(i + 1), NewPointList(i + 2))
colPoints.Add(testIntersection)
Next
Dim dTestDist As Double
Dim currentClosePoint As Point3d
Dim dCurrentLeastDist As Double
For i = 1 To colPoints.Count
Testpoint = colPoints.Item(i)
If arcstart.DistanceTo(Testpoint) < arcEnd.DistanceTo(Testpoint) Then
dTestDist = arcstart.DistanceTo(Testpoint)
If i = 1 Then
dCurrentLeastDist = dTestDist
currentClosePoint = Testpoint
Else
If dTestDist < dCurrentLeastDist Then
dCurrentLeastDist = dTestDist
currentClosePoint = Testpoint
End If
End If
Else ' testpoint is closer to end
dTestDist = arcEnd.DistanceTo(Testpoint)
If i = 1 Then
dCurrentLeastDist = dTestDist
currentClosePoint = Testpoint
Else
If dTestDist < dCurrentLeastDist Then
dCurrentLeastDist = dTestDist
currentClosePoint = Testpoint
End If
End If
End If
Next
Return DirectCast(currentClosePoint.ToArray(), Double())
End Function
Thanks Tony and Hallex for your help and ideas.
I finally got it all working...at least for the cases i've tested it on, probably some weird boundary shapes that may not work, but so far so good.