Drawing arcs in CADPolyLine manually

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
thomascheah
Posts: 26
Joined: 17 Oct 2007, 06:46
Location: Malaysia
Contact:

Drawing arcs in CADPolyLine manually

Post by thomascheah » 30 Apr 2008, 19:35

If I want to draw the arc of a CADPolyLine manually, how would I do that?

I found that the Vertex3D of CADPolyLine.Vertexes property has a Bulge property that determine the arc roundedness. How do I translate this property (and other relevant properties of Vertex3D) to the parameters of DrawArc method in .NET?

Thanks!
Objective World Pvt. Ltd.
"Turning Knowledge Into Wisdom."
http://www.objectiveworld.com

thomascheah
Posts: 26
Joined: 17 Oct 2007, 06:46
Location: Malaysia
Contact:

Re: Drawing arcs in CADPolyLine manually

Post by thomascheah » 05 May 2008, 11:55

Hmm... nobody has any ideas on this? Or no one understands what I am talking about? :)

I am curious how does CAD Import.NET inteprete the Vertex3D properties CADPolyLine.Vertexes property to draw arcs.
Objective World Pvt. Ltd.
"Turning Knowledge Into Wisdom."
http://www.objectiveworld.com

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Drawing arcs in CADPolyLine manually

Post by support » 06 May 2008, 09:32

Hi,

CADPolyLine is already split to a set of points which allow to draw it taking into account its line type.

CADPolyLine.dottedSingPts - contains a list of points to which polyline is split. It is necessary to take pairs of these points to draw polyline's segments and they can draw a CADPolyLine entity with all its lines and arcs.
I am curious how does CAD Import.NET inteprete the Vertex3D properties CADPolyLine.Vertexes property to draw arcs.
It is closed information. It can't be discovered.

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

thomascheah
Posts: 26
Joined: 17 Oct 2007, 06:46
Location: Malaysia
Contact:

Re: Drawing arcs in CADPolyLine manually

Post by thomascheah » 06 May 2008, 11:14

Thanks Sergey! I know about the DottedSingPts property, but that's a less than my ideal way as it is still a finite set points that are pre-splitted by the library. What I want is to able to interprete the attributes of CADPolyLine manually so that I can decide how to split it myself at different resolutions to produce arcs of different smoothness under various modes in my application. Also, that allows me to perform various geometric compuation that is not available under CAD Import library.

Having said that, I don't mean you should expose CAD Import.NET source code here. As long as you can let me know how to inteprete various attributes of Vertex3D of CADPolyLine.Vertexes property related to an arc shape mathematically, that's all I am asking for. I just thought if you can let me know how the attributes of Vertex3D can be mapped to the parameters of DrawArc method in .NET, that be the easiest way for me to understand, and also others that keen to know.
Objective World Pvt. Ltd.
"Turning Knowledge Into Wisdom."
http://www.objectiveworld.com

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Drawing arcs in CADPolyLine manually

Post by support » 07 May 2008, 15:05

Hi Thomas,

The only information we can share with you can be found in official documentation from Autodesk - DXF Reference:
ENTITIES Section -> VERTEX -> Group code 42:

Bulge (optional; default is 0). The bulge is the tangent of one fourth the included angle for an arc segment, made negative if the arc goes clockwise from the start point to the endpoint. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle.

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

francoas
Posts: 10
Joined: 26 Jun 2007, 18:22

Re: Drawing arcs in CADPolyLine manually

Post by francoas » 27 Mar 2009, 19:14

Hi Sergey
The only information we can share with you can be found in official documentation from Autodesk - DXF Reference:
ENTITIES Section -> VERTEX -> Group code 42:

Bulge (optional; default is 0). The bulge is the tangent of one fourth the included angle for an arc segment, made negative if the arc goes clockwise from the start point to the endpoint. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle.
For a 3D polyline, given two 3D points in the space and a bulge, how dow I know which is the plane where the arc lies ?

Thanks

Franco

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Drawing arcs in CADPolyLine manually

Post by support » 30 Mar 2009, 09:27

Hello Franco,

AutoCAD ignores bulges for a 3D polyline. There is no sense to have bulges in a 3D polyline. It is necessary to check Z coordinate for given two 3D points to determine if they are in the same plane.

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

francoas
Posts: 10
Joined: 26 Jun 2007, 18:22

Re: Drawing arcs in CADPolyLine manually

Post by francoas » 30 Mar 2009, 12:26

Thanks, Sergey.

I asked that because your demo tools don't ignore the bulges in 3D.
I edited a 2D file with bulges inserting Z coordinates (tag 30) and the viewer had unexpected results.

Bye.

Franco

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Drawing arcs in CADPolyLine manually

Post by support » 30 Mar 2009, 16:11

Hello Franco,
francoas wrote: I asked that because your demo tools don't ignore the bulges in 3D.
I edited a 2D file with bulges inserting Z coordinates (tag 30) and the viewer had unexpected results.
this is incorrect behaviour in the demo. It will be fixed in future.

The base is:
3D polyline should not containg bulges.
2D polilne (LWPolyline) has bulges but it does not support Z coordinate.

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply