microsoft / maker.js

📐⚙ 2D vector line drawing and shape modeling for CNC and laser cutters.

Home Page:http://maker.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get updated endpoint of small Arcs in Elliptic Arc after changing origin

nayabatir1 opened this issue · comments

var makerjs = require('makerjs');

var arc = new makerjs.models.EllipticArc(289, 251, 75, 100);

var arc_0Path = ['models', 'Curve_1','paths', 'arc_0'];
var arc_0_1 = makerjs.travel(arc, arc_0Path).result;

console.log(makerjs.point.fromPathEnds(arc_0_1));

makerjs.model.move(arc, [10, 10]);

var arc_0_2 = makerjs.travel(arc, arc_0Path).result;

console.log(makerjs.point.fromPathEnds(arc_0_2));

this.models = {model: arc};

This is simple elliptic arc, path end coords for arc_0 is same even after changing the origin of Model. How to get the updated endpoints of small arcs after model is moved.

You may want to look at originating.

Thanks @danmarshall this solves my issue