edwilliams16 wrote: ↑Sun May 02, 2021 1:27 am
...
I'm not sure you are reading what I said carefully.
More like reading the words and misinterpreting based on my preconceived notions. Thus, my problem not yours.
And I appreciate your patience.
- The center argument of the arcFrom2Pts function is the center of the circle of which the arc is part.
- This function, because it is 3D, will randomly fail in one case - when the required arc is a semicircle. Equivalently, it fails when the center is at the mid-point of the chord between the arc endpoints.
I see that now and other things in this routine continue to become clear. It seems in my glee of finding a routine that I perceived, by the name, to be the thing I needed, my use case happens to be a failure mode.
I can easily write a function that will create an arc given two endpoints and the arc center, but it needs additional specification.
- Which arc is desired? The short/long one? Counter/Clockwise from point 1 to point 2?
- To handle the case where we have a semi-circle, we need (1) the plane in which the semi-circle is to be created (XY, if you require z=0 in the inputs, or more generally we need the normal to the circle plane) (2) Which of the two semi-circular arcs do you want in this case?
For me, it is simpler to write the required function from scratch than to find and debug existing code.
I, maybe naively, expect that most of the basic geometry creation helpers would be readily available in a 20 year old piece of CAD code. I'm loath to recreate a wheel that exists.
As for the direction of the arc, is that not what the axis argument addresses? I.e. (0,0,1) is CCW and (0,0,-1) being CW
Again, my ignorance...
This all started because, figuring it would be a good learning exercise..., I wanted to create a generic script that would allow the user to enter various parameters and it would produce the following two arcs:
- AddArcs2Sausage.gif (514.03 KiB) Viewed 1198 times
Of course I need to make the ends tangent and other constraints so the user ends up with something that can be dragged around if desired.
I have this bookmarked and will be studying it. Thank you.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."