ObjectARX

ObjectARX

Reply
Active Member
njlhb
Posts: 8
Registered: ‎12-19-2005
Message 1 of 3 (108 Views)

How to create the center line of Road?

108 Views, 2 Replies
04-09-2006 08:58 PM
Hi ,everyone,I am a chinese student,how to create the center line of Road from two parallel lines ?
*Matt
Message 2 of 3 (108 Views)

Re: How to create the center line of Road?

04-10-2006 12:58 AM in reply to: njlhb
Assuming you already have the two lines.

AcGePoint3d ptStart1 = pLine1->startPoint();
AcGePoint3d ptEnd1 = pLine1->endPoint();
AcGePoint3d ptStart2 = pLine2->startPoint();
AcGePoint3d ptEnd = pLine2->startPoint();

AcGeVector3d vStart = pStart2-pStart1;
AcGeVector3d vEnd = pEnd2-pEnd1;

AcGePoint3d ptStartMid = ptStart1+vStart/2.0;
AcGePoint3d ptEndMid = ptEnd1+vEnd/2.0;

AcDbLine* pMidLine = new AcDbLine( pStartMid, ptEndMid);


Or a more generic approach, if the lines are not always lines, but always
same distance apart (like in a curve)
is to have a look at AcDbCurve::getOffsetCurves


/Matt


wrote in message news:5137173@discussion.autodesk.com...
Hi ,everyone,I am a chinese student,how to create the center line of Road
from two parallel lines ?
Active Member
frtfff
Posts: 8
Registered: ‎06-24-2006
Message 3 of 3 (108 Views)

Re: How to create the center line of Road?

06-24-2006 05:50 AM in reply to: njlhb
how about to write a few xdata in your lines(including arc or polylines),after that you can filter this data to distinguish other lines.
Lix Xu ,china
Frtfff@sina.com
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.