Assembly: Fix lengths cannot be negative (#24625)

* Assembly: Fix lengths cannot be negative

* Update PropertyUnits.cpp

* Update PropertyUnits.h

* Update JointObject.py
This commit is contained in:
PaddleStroke
2025-10-14 11:40:10 +02:00
committed by GitHub
parent c55e1c3bba
commit a0c28aba75
4 changed files with 24 additions and 1 deletions

View File

@@ -518,7 +518,12 @@ TYPESYSTEM_SOURCE(App::PropertyLength, App::PropertyQuantityConstraint)
PropertyLength::PropertyLength()
{
setUnit(Base::Unit::Length);
setConstraints(&LengthStandard);
enableNegative(false);
}
void PropertyLength::enableNegative(bool on)
{
setConstraints(on ? nullptr : &LengthStandard);
}
//**************************************************************************
@@ -863,3 +868,4 @@ PropertyYoungsModulus::PropertyYoungsModulus()
{
setUnit(Base::Unit::YoungsModulus);
}