I am struggling with computing a parallel line to the existing line in certain distance.
I have tried:
If i understand correctly you are trying to create a parallel line to an already existing line.
If you not specifically looking for OdGeLine2d , i have a solution for similar problem with OdDbLine.
As you already know , to construct a new line if we have its end points rest is play.
So I will help you find end Points of Parallel Line with OdDbLine Class. You can try to derive from it. My code is the .Net version code and not the c++ one.
If you have and object of
OdDbLine Class lets say
a) Get its End Points
OdGePoint3d startPoint = new OdGePoint3d();
OdGePoint3d endPoint = new OdGePoint3d();
OdGeVector3d lineVector = GetLineVector(line); OdGeVector3d perpendicularVec = lineVector.perpVector(); perpendicularVec.normalize(); perpendicularVec = perpendicularVec.Mul(-1);
OdGePoint3d newOffsetStartPt = startPoint.Add(perpendicularVec); OdGePoint3d newOffsetEndPt = endPoint.Add(perpendicularVec);
Hope it helps !!