ObjectARX

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

How to create the center line of Road?

107 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 (107 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 (107 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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.