Ignore:
Timestamp:
12/28/20 02:06:52 (4 years ago)
Author:
Maciej Komosinski
Message:

Cosmetic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/geometry/geometryutils.cpp

    r1045 r1056  
    369369}
    370370
    371 double GeometryUtils::calculateSolidVolume(Part * part)
     371double GeometryUtils::calculateSolidVolume(const Part * part)
    372372{
    373373        double radiiProduct = part->scale.x * part->scale.y * part->scale.z;
     
    386386}
    387387
    388 bool GeometryUtils::isSolidPartScaleValid(const Part::Shape &partShape, const Pt3D &scale)
     388bool GeometryUtils::isSolidPartScaleValid(const Part::Shape &partShape, const Pt3D &scale, bool ensureCircleSection)
    389389{
    390390        Part *tmpPart = new Part(partShape);
     
    402402                return false;
    403403
    404         if (partShape == Part::Shape::SHAPE_ELLIPSOID && scale.maxComponentValue() != scale.minComponentValue()) // When any radius has a different value than the others
    405                 return false;
    406         if (partShape == Part::Shape::SHAPE_CYLINDER && scale.y != scale.z) // If base radii have different values
    407                 return false;
     404        if (ensureCircleSection)
     405        {
     406                if (partShape == Part::Shape::SHAPE_ELLIPSOID && scale.maxComponentValue() != scale.minComponentValue()) // Any radius has a different value than the other ones?
     407                        return false;
     408                if (partShape == Part::Shape::SHAPE_CYLINDER && scale.y != scale.z) // Base radii have different values?
     409                        return false;
     410        }
    408411        return true;
    409412}
Note: See TracChangeset for help on using the changeset viewer.