Giter VIP home page Giter VIP logo

Comments (6)

domoszlai avatar domoszlai commented on September 16, 2024

You do not need the DPI in this case as 26cm is ~10in so the SVG has ~50DPI. This reflected in juicy-gcode --help:

image

I feel like a warning would be appropriate, but also luxurious :D

from juicy-gcode.

domoszlai avatar domoszlai commented on September 16, 2024

Actually, there might be a bug in the current implementation:

<svg width="10cm" height="10cm" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <rect x="1cm" y="1cm" width="10" height="20"/>
</svg>

Not sure in this case what should happen...

from juicy-gcode.

domoszlai avatar domoszlai commented on September 16, 2024

Looking at this example:

<svg width="10cm" height="10cm" viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg">
  <rect x="1in" y="1in" width="10" height="20"/>
  <rect x="96" y="96" width="10" height="20"/>
</svg>

The two rectangles rendered to the same spot independently of what the viewBox is. Thus, some default DPI is used to do the inner conversion, event though, the document size is in cm. This is exactly how juicy-gcode works, so the DPI setting still required

from juicy-gcode.

monperrus avatar monperrus commented on September 16, 2024

I confirm that with this example, -d has an effect on the first rectangle.

Now coming back to the use case.

I was changing -d without any effect on the output. After a tedious debug session, I realized that the input SVG had something new: the real length.

What would be the luxurious message to save me precious time?

Maybe "Drawing area {X}cm x {Y}cm onto gcode max_x=100,max_y=100"

Thanks!

from juicy-gcode.

domoszlai avatar domoszlai commented on September 16, 2024

But as my previous example suggests, even if the width and height of the SVG is in cm, you might need the DPI to render it.
So I can't give a warning like "-d option ignored because SVG height and width are in centimeters", because it is not true (it might not being used but it is not ignored).

I also can't just dump debug messages to the standard output freely as I might break other people's application.

I could probably add like a debug or info flag...

from juicy-gcode.

monperrus avatar monperrus commented on September 16, 2024

from juicy-gcode.

Related Issues (20)

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.