ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create the center line of Road?

2 REPLIES 2
Reply
Message 1 of 3
njlhb
263 Views, 2 Replies

How to create the center line of Road?

Hi ,everyone,I am a chinese student,how to create the center line of Road from two parallel lines ?
2 REPLIES 2
Message 2 of 3
Anonymous
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 ?
Message 3 of 3
frtfff
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost