Code Monkey home page Code Monkey logo

Comments (4)

mattdesl avatar mattdesl commented on August 29, 2024

Hmm that's odd ! Could be due to either. I can look into this but I think I'd need your code — or another test case that shows the same error.

Also, you could try passing { optimize: false } to the pathsToSVG penplot function, as it might be due to something there.

from canvas-sketch-util.

jzting avatar jzting commented on August 29, 2024

{ optimize: false } didn't seem to work. Thanks for taking a look!

https://gist.github.com/jzting/dbf964cc7d0726d3f032cae1e5a3fa64

from canvas-sketch-util.

mattdesl avatar mattdesl commented on August 29, 2024

Alright, pretty odd but I think there is some bug with d3-path. Hard to track down exactly what's going on here.

Instead of using createPath() which uses d3 under the hood, you can use my own arc-to module which seems to produce correct results, and which just returns a list of points.

const createArc = require('arc-to');

// ... inside drawArc () ...
  const arc = createArc(center.x, center.y, radius, startAng, endAng, positiveRotation);
  paths.push(arc);

from canvas-sketch-util.

jzting avatar jzting commented on August 29, 2024

Thank you so much, Matt. That worked perfectly!

from canvas-sketch-util.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.