microsoft / maker.js

šŸ“āš™ 2D vector line drawing and shape modeling for CNC and laser cutters.
http://maker.js.org
Apache License 2.0
1.76k stars 269 forks source link

Need help with design #593

Open nayabatir1 opened 4 months ago

nayabatir1 commented 4 months ago
image

I'm unable to find solution any where hence posting here. I want to make highlighted portion smooth, radius should be 120. My design is combination of Elliptic Arc, Arc, and line. I want all to be seamless smooth. I've used hard coded values for demonstration purposes.

code

var makerjs = require('makerjs');

function demo(startAngle, endAngle, radiusX, radiusY) {

  var example = new makerjs.models.EllipticArc(startAngle, endAngle, radiusX, radiusY);

  var arc = new makerjs.paths.Arc([35.00000002352587,-69.28203202838824], [20, -89], 120, false, false);

  var line1 = new makerjs.paths.Line([20,-89.00000002838823], [18.00000002352587,-109.28203202838823]);

  makerjs.model.addPath(example, arc, 'arc');
  makerjs.model.addPath(example, line1, 'line');

  var fillet = makerjs.chain.fillet(
     makerjs.model.findSingleChain(example),
     120
   );

//  var fillet1 = new makerjs.path.fillet(arc, line1, 20);

    this.models = {
     example: example,
      fillet: fillet
    };

}

demo.metaParameters = [
  { title: "startAngle", type: "range", min: 0, max: 90, value: 300 },
  { title: "endAngle", type: "range", min: 90, max: 360, value: 240 },
  { title: "radiusX", type: "range", min: 1, max: 50, value: 70 },
  { title: "radiusY", type: "range", min: 1, max: 50, value: 80 }
];

module.exports = demo;
rohitCodeBuddy commented 4 months ago

Yup, facing same issue here as well , I also didn't find any way to do it

danmarshall commented 4 months ago

You may want to try your drawing as circles first, then distort it to get it as elliptical.

nayabatir1 commented 3 months ago

You may want to try your drawing as circles first, then distort it to get it as elliptical.

Hey @danmarshall it didn't worked.

Could you recommend someone with expertise in Maker.js? They will be compensated for their efforts. I'm sharing design that needs to done. It should be scalable.

image