Hi,
I am searching for the
b-rep subroutine that Acad uses to display the arc and circles, by
segmenting them according to their length.
Can anyone help me?
Are you looking to take the vector components of a circle or arc and convert them to smaller segments? Is this for calculation or just to represent them visually?
Just a thought. If you do not actually want to "break up" the arc but only use points for calculation. You can "Divide" the arc into equal vector points by using the DIVIDE command. You could then use the points to calculate from. Otherwise, you could 1)similarly create those points and then draw the segments in between each point or 2) calculate from the center, radius, and the start and end points to create a matrix of vector points to draw each segment with.
About using the polygon command since a circle is a polygon with an infinite number of straight sides. You can then trim portion of the polygon below the cord drawn as a straight line to identify the portion of the arc that you are interested. You may then try array "point" on the corners of the newly formed arc and use LIST to identify the positions (X,Y) of the point marks identifying the corners fo the straight sides of the arc . Would be a good idea to relocate UCS to the center of the original polygon before listing the locations of the points.
The DXF group codes for the arc that might apply for your routine are:
Arc group codes:
10 Center point (in OCS). DXF: X value; APP: 3D point
20, 30 DXF: Y and Z values of center point (in OCS)
40 Radius
50 Start angle
51 End angle
Lwpolyline group codes:
10 Vertex coordinates (in WCS), multiple entries; one entry for each vertex. DXF: X value; APP: 2D point
20 DXF: Y value of vertex coordinates (in WCS), multiple entries; one entry for each vertex
90 Number of vertices.
128 = plinegen
There also is a lisp routine called "Circle2Pline" by Jason Piercey that converts circles to polylines using lwpolines. What it does is change a circle to a polyine, and then you will later be able to change the width of the line (you cannot change the width of a circle, and you do not have to use the donut command.
It does not work on circles, but you may want to study it and it might lead you to some ideas for your routine.
Hi,
Didn't want to leave you hanging. It can be written in LISP if you want. Does not sound especially hard. Contact me if you want to do something with it.