microsoft / microsoft/maker.js

"TypeError: Cannot read property 'low' of undefined" - When running combine with pointMatchingDistance

Open
#455 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
2k
Forks
302
Avg merge
21h 28m
Merged PRs (30d)
5

Description

I've been making great progress with maker.js but hit a problem now.

Makerjs version used: makerjs@^0.17.0
What did you try to do:

I was trying to use

    let options = {pointMatchingDistance: 0.006}
    makerjs.model.combine(modelA, modelB, false, true, false, true, options)

instead of just makerjs.model.combineUnion(modelA, modelB).

What happened:

TypeError: Cannot read property 'low' of undefined

Stack trace:
Uncaught TypeError: Cannot read property 'low' of undefined
    at Object.isMeasurementOverlapping (index.js:4877)
    at Object.onPath (index.js:3148)
    at walkRecursive (index.js:2898)
    at Object.walk (index.js:2929)
    at Object.onPath (index.js:3159)
    at walkRecursive (index.js:2898)
    at walkRecursive (index.js:2920)
    at walkRecursive (index.js:2920)
    at Object.walk (index.js:2929)
    at breakAllPathsAtIntersections (index.js:3177)
    at Object.combine (index.js:3314)
    at combineModel (DXFAnalyzer.ts:413)
    at recreateModel (DXFViewer.js:153)
    at DXFViewer.js:169
    at commitHookEffectList (react-dom.development.js:22010)
    at commitPassiveHookEffects (react-dom.development.js:22043)
    at HTMLUnknownElement.callCallback (react-dom.development.js:337)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:386)
    at invokeGuardedCallback (react-dom.development.js:439)
    at flushPassiveEffectsImpl (react-dom.development.js:25379)
    at unstable_runWithPriority (scheduler.development.js:701)
    at runWithPriority$2 (react-dom.development.js:12231)
    at flushPassiveEffects (react-dom.development.js:25348)
    at react-dom.development.js:25227
    at workLoop (scheduler.development.js:645)
    at flushWork (scheduler.development.js:600)
    at MessagePort.performWorkUntilDeadline (scheduler.development.js:197)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the call to makerjs.model.combine with pointMatchingDistance 0.006 and trace it through DXFAnalyzer.ts, DXFViewer.js, and the combine entry point. Inspect isMeasurementOverlapping and breakAllPathsAtIntersections around the reported stack frames; done means the call no longer throws and its behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.