Skip to content

Commit

Permalink
Sketcher: Fix Point to Line Distance
Browse files Browse the repository at this point in the history
  • Loading branch information
FlachyJoe authored and abdullahtahiriyo committed Dec 20, 2023
1 parent 66f172a commit 482b45d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,13 @@ void EditModeConstraintCoinManager::processConstraints(const GeoListFacade& geol
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;
Expand Down

0 comments on commit 482b45d

Please sign in to comment.