maker.js icon indicating copy to clipboard operation
maker.js copied to clipboard

Need help with design

Open nayabatir1 opened this issue 8 months ago • 3 comments

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;

nayabatir1 avatar Jun 05 '24 10:06 nayabatir1