Skip to content

Commit 7b5d7d4

Browse files
Fixed Toolpath Layer modifier index handling
1 parent 06eb9e0 commit 7b5d7d4

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

Implementation/Core/amc_toolpathlayerdata.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,20 +491,21 @@ namespace AMC {
491491

492492
for (uint32_t nHatchIndex = 0; nHatchIndex < hatchFactors.size(); nHatchIndex++) {
493493
uint32_t nSubInterpolationCount = 0;
494-
Lib3MF::sHatchModificationInterpolationData* pSubInterpolationData = nullptr;
494+
uint32_t nSubInterpolationOffset = 0;
495+
//Lib3MF::sHatchModificationInterpolationData* pSubInterpolationData = nullptr;
495496
if (nonLinearCounts.size() > 0) {
496497
nSubInterpolationCount = nonLinearCounts.at(nHatchIndex);
497498
if (nSubInterpolationCount > 0)
498-
pSubInterpolationData = &m_InterpolationData.at(nInterpolationDataStartIndex + nTotalSubInterpolationCount);
499+
nSubInterpolationOffset = (uint32_t)(nInterpolationDataStartIndex + nTotalSubInterpolationCount);
499500
}
500501

501502
pDstOverride->m_dFactors[nFactorIndex] = pSrcOverride->m_Point1Factor;
502503
pDstOverride->m_nSubInterpolationCount = nSubInterpolationCount;
503-
pDstOverride->m_pSubInterpolationData = pSubInterpolationData;
504+
pDstOverride->m_nSubInterpolationOffset = nSubInterpolationOffset;
504505
pDstOverride++;
505506
pDstOverride->m_dFactors[nFactorIndex] = pSrcOverride->m_Point2Factor;
506507
pDstOverride->m_nSubInterpolationCount = nSubInterpolationCount;
507-
pDstOverride->m_pSubInterpolationData = pSubInterpolationData;
508+
pDstOverride->m_nSubInterpolationOffset = nSubInterpolationOffset;
508509
pDstOverride++;
509510
pSrcOverride++;
510511

@@ -1084,7 +1085,8 @@ namespace AMC {
10841085
uint32_t nStartIndex = pSegment->m_PointStartIndex;
10851086
if (pSegment->m_PointCount > 0) {
10861087
uint32_t nPointIndex = nStartIndex + nHatchIndex * 2;
1087-
pSubInterpolationData = m_OverrideFactors.at(nPointIndex).m_pSubInterpolationData;
1088+
uint32_t nSubInterpolationOffset = m_OverrideFactors.at(nPointIndex).m_nSubInterpolationOffset;
1089+
pSubInterpolationData = &m_InterpolationData.at (nSubInterpolationOffset);
10881090
nSubInterpolationCount = m_OverrideFactors.at(nPointIndex).m_nSubInterpolationCount;
10891091
}
10901092
else {

Implementation/Core/amc_toolpathlayerdata.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ namespace AMC {
6666

6767
typedef struct _sToolpathLayerOverride {
6868
uint32_t m_nSubInterpolationCount;
69-
Lib3MF::sHatchModificationInterpolationData * m_pSubInterpolationData;
69+
uint32_t m_nSubInterpolationOffset;
70+
//Lib3MF::sHatchModificationInterpolationData * m_pSubInterpolationData;
7071
double m_dFactors[3]; // F, G and H
7172
} sToolpathLayerOverride;
7273

Implementation/LibMCEnv/libmcenv_toolpathlayer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,12 @@ void CToolpathLayer::EvaluateTypedHatchProfileInterpolation(const LibMCEnv_uint3
513513

514514
uint32_t nTotalCount = 0;
515515

516+
LibMCEnv::sHatch2DSubInterpolationData* pTargetHatchInterpolationData = pEvaluationDataBuffer;
517+
516518
for (uint64_t nHatchIndex = 0; nHatchIndex < nNeededHatchCount; nHatchIndex++) {
517519

518520
uint32_t nSubInterpolationCount = 0;
519521
Lib3MF::sHatchModificationInterpolationData * pSourceHatchInterpolationData = nullptr;
520-
LibMCEnv::sHatch2DSubInterpolationData* pTargetHatchInterpolationData = pEvaluationDataBuffer;
521522
m_pToolpathLayerData->getHatchSubinterpolationData(nSegmentIndex, (uint32_t)nHatchIndex, nSubInterpolationCount, pSourceHatchInterpolationData);
522523

523524
pCountArrayBuffer[nHatchIndex] = nSubInterpolationCount;

0 commit comments

Comments
 (0)