Cam simulator feature update (#15597)

* remove redundant code

* Improve lighting, add ambient occlusion

* Add cleanup code. Dialog is now deleted when cloesd.

* change back to ambient occlusion

* Fix G8x drill sequence bug.  issue #14369

* fix bad simulation artifacts under Linux and QT. Issue #14369

* fix merge issue

* fix border artifact on buttons

* support showing path lines. revise the gui.

* add option for arbitrary solids. wip

* use vectors instead of mallocs

* Handle arbitrary stock shapes + show base shape.

* Complete the base shape display feature. eliminate co-planar artifacts.

* support window scaling. upstream issue #14334

* Apply lint fixes

* some missing lints.

* Attend pylint issues

* Apply code fixes based on @kadet1090 review

* fix some clang-tidy warnings.

* CAM: Linter cleanup round 1

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
This commit is contained in:
Shai Seger
2024-08-21 23:18:52 +03:00
committed by GitHub
parent 80a09b3853
commit a750034490
42 changed files with 2744 additions and 1067 deletions

View File

@@ -56,11 +56,8 @@ float MillPathSegment::mResolution = 1;
float MillPathSegment::mSmallRadStep = (PI / 8);
MillPathSegment::MillPathSegment(EndMill* _endmill, MillMotion* from, MillMotion* to)
: mShearMat {{1.0F, 0.0F, 0.0F, 0.0F},
{0.0F, 1.0F, 0.0F, 0.0F},
{0.0F, 0.0F, 1.0F, 0.0F},
{0.0F, 0.0F, 0.0F, 1.0F}}
{
mat4x4_identity(mShearMat);
MotionPosToVec(mStartPos, from);
MotionPosToVec(mDiff, to);
vec3_sub(mDiff, mDiff, mStartPos);
@@ -142,6 +139,32 @@ MillPathSegment::~MillPathSegment()
}
void MillPathSegment::AppendPathPoints(std::vector<MillPathPosition>& pointsBuffer)
{
MillPathPosition mpPos;
if (mMotionType == MTCurved) {
float ang = mStartAngRad;
float z = mStartPos[PZ];
float zStep = mDiff[PZ] / numSimSteps;
for (int i = 1; i < numSimSteps; i++) {
ang -= mStepAngRad;
z += zStep;
mpPos.X = mCenter[PX] - sinf(ang) * mRadius;
mpPos.Y = mCenter[PY] + cosf(ang) * mRadius;
mpPos.Z = z;
mpPos.SegmentId = segmentIndex;
pointsBuffer.push_back(mpPos);
}
}
else {
mpPos.X = mStartPos[PX] + mDiff[PX];
mpPos.Y = mStartPos[PY] + mDiff[PY];
mpPos.Z = mStartPos[PZ] + mDiff[PZ];
mpPos.SegmentId = segmentIndex;
pointsBuffer.push_back(mpPos);
}
}
void MillPathSegment::render(int step)
{
mStepNumber = step;