bulge center DXF .NET

bulge center DXF .NET

Anonymous
Not applicable
5,911 Views
5 Replies
Message 1 of 6

bulge center DXF .NET

Anonymous
Not applicable

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.

0 Likes
Accepted solutions (1)
5,912 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend

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.

 

Capture.PNG

0 Likes
Message 3 of 6

Anonymous
Not applicable

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.

0 Likes
Message 4 of 6

pendean
Community Legend
Community Legend
Same issue: there is no by-design .NET access in AutoCADLT either, all part of the discount pricing of LT https://microsolresources.com/wp-content/uploads/2018/03/autocad-autocad-lt-2019-comparison-matrix-e...

.NET dedicated forum is over here if you have access to full AutoCAD and wish to not use the LISP you found https://forums.autodesk.com/t5/net/bd-p/152



0 Likes
Message 5 of 6

Anonymous
Not applicable

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)

0 Likes
Message 6 of 6

steven-g
Mentor
Mentor
Accepted solution

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.

0 Likes