GetArcSegmentAt bug ?

GetArcSegmentAt bug ?

bikelink
Contributor Contributor
634 Views
3 Replies
Message 1 of 4

GetArcSegmentAt bug ?

bikelink
Contributor
Contributor
I have a simple plyne-arc in my dwg..

when I try to get the arc with this

CircularArc3d a = this.MyPlyneArx.GetArcSegmentAt(0);

a.StartAngle is always 0.0
of course I haven't an angle zero...

it's looks like it's give us the absolute angle between the vector v1 (p1 and center) and v2 (p2 center) with the first vector-ray on x Axis..

when I draw the arc-plyne i Have a bulge...and 2 differents angles..(no one at zero..) and I don't understand why this
"GetArcSegmentAt" give me a different arc..

i go crazy...!
0 Likes
635 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Check "Arc circArc2Arc(CircularArc3d circArc)"
at
http://through-the-interface.typepad.com/through_the_interface/2007/08/generating-koch.html
0 Likes
Message 3 of 4

bikelink
Contributor
Contributor
thank you...that's a bug...
0 Likes
Message 4 of 4

Anonymous
Not applicable
If what you actually need is the 'exploded' Arc or Line equivalent of a polyline segment, it may be easier to use the GetSubEntity method.

Here's a wrapper for it:

public static class PolylineHelper
{
public static Curve GetCurveAt( Polyline pline, int index )
{
return pline.GetSubentity(
new FullSubentityPath(
new ObjectId[] { pline.ObjectId },
new SubentityId( SubentityType.Edge, index + 1 ) ) );
}
}

/// usage:

Polyline pline = // the Polyline
int index = // 0-based index of segment to get

Curve curve = PolylineHelper.GetCurveAt( pline, index );

The resulting Curve will be an Arc or a Line, depending on if the segment at 'index' is curved or straight. You must call Dispose() on the resulting Curve once you're done using it, if you don't add it to the database.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:[email protected]...
I have a simple plyne-arc in my dwg..

when I try to get the arc with this

CircularArc3d a = this.MyPlyneArx.GetArcSegmentAt(0);

a.StartAngle is always 0.0
of course I haven't an angle zero...

it's looks like it's give us the absolute angle between the vector v1 (p1 and center) and v2 (p2 center) with the first vector-ray on x Axis..

when I draw the arc-plyne i Have a bulge...and 2 differents angles..(no one at zero..) and I don't understand why this
"GetArcSegmentAt" give me a different arc..

i go crazy...!