Sketcher: Fix Point to Line Distance
This commit is contained in:
committed by
abdullahtahiriyo
parent
66f172ab4b
commit
482b45dadc
@@ -826,14 +826,13 @@ Restart:
|
||||
auto geo1 = geolistfacade.getGeometryFromGeoId(Constr->First);
|
||||
auto geo2 = geolistfacade.getGeometryFromGeoId(Constr->Second);
|
||||
if (isLineSegment(*geo2)) {
|
||||
// point to line distance
|
||||
// NOLINTNEXTLINE
|
||||
auto lineSeg = static_cast<const Part::GeomLineSegment*>(geo2);
|
||||
Base::Vector3d l2p1 = lineSeg->getStartPoint();
|
||||
Base::Vector3d l2p2 = lineSeg->getEndPoint();
|
||||
|
||||
if (Constr->SecondPos != Sketcher::PointPos::none) {
|
||||
|
||||
if (Constr->FirstPos != Sketcher::PointPos::none) {
|
||||
// point to line distance
|
||||
// calculate the projection of p1 onto line2
|
||||
pnt2.ProjectToLine(pnt1 - l2p1, l2p2 - l2p1);
|
||||
pnt2 += pnt1;
|
||||
|
||||
Reference in New Issue
Block a user