I am attempting to find the center point of a bulge between 2 vertices on a lwpolyline.
Given: p1, p2, and the bulge.
I have been able to calculate the radius and then found the 2 possible center points.
But i have no clue how to determine which is the actual center point.
I found this code describing the process, unfortunately, it is in lisp which I do not know.
;; Bulge Center - Lee Mac
;; p1 - start vertex
;; p2 - end vertex
;; b - bulge
;; Returns the center of the arc described by the given bulge and vertices
(defun LM:BulgeCenter ( p1 p2 b )
(polar p1
(+ (angle p1 p2) (- (/ pi 2) (* 2 (atan b))))
(/ (* (distance p1 p2) (1+ (* b b))) 4 b)
)
)
Any help would be great.
Please note that this is for a standalone application and cannot use any of the AutoCAD API's.
Solved! Go to Solution.
Solved by steven-g. Go to Solution.
AutoCADLT cannot run lisp or do anything close to automatically find the center of the bulge.
You will need to do it all manually or get access to a full AutoCAD seat to run the LISP routine.
I am well aware of that, please read the original post and see that I am writing a "Standalone application".
I have seen that image, unfortunately, given 2 points and a radius, there are 2 possible arcs, not just 1.
I do not have access to a full version of AutoCAD. But since the vertices and bulge are all that is needed to reconstruct the arc for AutoCAD I should be able to as well, right? (Autocad can read a *.DXF file and know where the center is)
Whether the bulge value is positive or negative, should tell you if the arc is clockwise or anticlockwise, which should give you the information you need when you have the points p1 and p2 and the bulge, as the radius you have worked out will only allow one centre point if you take the clock direction into account.
Can't find what you're looking for? Ask the community or share your knowledge.