microsoft / microsoft/maker.js

Calling distort(shape, 1.0, 1.0) changes path significantly

Open
#459 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

So, I'm investigating an issue I am seeing around the distort function.

(1) findChains on my original model returns a chain of 94 paths
(2) calling distort(shape, 1.0, 1.0) on the same model
(3) findChains this time comes back with 2 chains, one with 93 links with endless: false and one with 2 links that is endless.

I'm trying to further distill it down into a test example and dive deeper why this is happening, but it's weird that distort is changing the model so much, even when the scaling shouldn't change anything.

For now I have a screenshot of the part of my model before:

Screen Shot 2020-03-05 at 20 20 46

and after:

Screen Shot 2020-03-05 at 20 21 48

Hre's a picture of my full model:
Screen Shot 2020-03-05 at 20 23 29

EDIT: Changing the bezierAccuracy option did not make a difference, always the same result of these lines in the bottom curve becoming their own mini-loop.

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 reported comparison between findChains on the original model and after distort(shape, 1.0, 1.0), using the screenshots and the noted bezierAccuracy experiment as context. Trace distort and findChains to determine why unit scaling creates a separate endless mini-loop. Done means unit scaling preserves the original chain structure, including the 94-path result.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.