GithubHelp home page GithubHelp logo

Comments (9)

tbfleming avatar tbfleming commented on August 20, 2024

If the cutter can move to the starting position from the ending position in a straight line without crossing outside the cutting area then it doesn't go up to the safety height. I made this calculation conservative for safety. I limited it to a straight line because path-finding algorithms are pretty expensive.

from jscut.

peteruithoven avatar peteruithoven commented on August 20, 2024

I'm afraid there is an issue. Maybe something goes wrong when it's exactly the same position?
I can replicate it with the following rectangle.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="744.09448819"
   height="1052.3622047"
   id="svg3035"
   version="1.1"
   inkscape:version="0.48.2 r9819"
   sodipodi:docname="square.svg">
  <defs
     id="defs3037" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="1.1399139"
     inkscape:cx="375"
     inkscape:cy="520"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1244"
     inkscape:window-height="620"
     inkscape:window-x="20"
     inkscape:window-y="20"
     inkscape:window-maximized="0" />
  <metadata
     id="metadata3040">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <rect
       style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
       id="rect3043"
       width="344.72888"
       height="163.32452"
       x="200.88481"
       y="496.91034" />
  </g>
</svg>

Settings I used:

{"svg":{"pxPerInch":"90"},"material":{"units":"mm","thickness":25.4,"zOrigin":"Top","clearance":2.54},"curveToLineConversion":{"minNumSegments":"1","minSegmentLength":2.54},"tool":{"units":"mm","diameter":3.175,"angle":180,"passDepth":"5","stepover":0.4,"rapidRate":2540,"plungeRate":127,"cutRate":1016},"operations":{"operations":[{"rawPaths":[{"path":[["M",200.88481,496.91034],["L",545.61369,496.91034],["L",545.61369,660.23486],["L",200.88481000000002,660.23486],["L",200.88481000000002,496.91034]],"nonzero":true}],"name":"","units":"mm","enabled":true,"combineOp":"Union","camOp":"Engrave","direction":"Conventional","cutDepth":"20","ramp":false}]},"tabs":{"units":"mm","maxCutDepth":0,"tabs":[]},"gcodeConversion":{"units":"mm","gcodeFilename":"gcode.gcode","offsetX":0,"offsetY":0}}

If you point me to the peice of code that does this safety height I'd love to help out.

from jscut.

peteruithoven avatar peteruithoven commented on August 20, 2024

It's probably the safeToClose boolean or the tabGeometry.length on the following line:
https://github.com/tbfleming/jscut/blob/gh-pages/js/Cam.js#L411

from jscut.

tbfleming avatar tbfleming commented on August 20, 2024

Please use the gist save option in the future; it makes reproduction a lot easier.

Odd. safeToClose == true and tabGeometry.length == 0. It's not entering that condition, which means something else is retracting.

from jscut.

tbfleming avatar tbfleming commented on August 20, 2024

Found it. It should ignore tabZ at https://github.com/tbfleming/jscut/blob/gh-pages/js/Cam.js#L419 when tabGeometry.length == 0.

from jscut.

tbfleming avatar tbfleming commented on August 20, 2024

Also at https://github.com/tbfleming/jscut/blob/gh-pages/js/Cam.js#L418

from jscut.

peteruithoven avatar peteruithoven commented on August 20, 2024

Nice! I was just going to mention that it's not the retractGcode part, but the Rapid to initial position part.

from jscut.

tbfleming avatar tbfleming commented on August 20, 2024

Good news! It means someone else can read my code :)

from jscut.

peteruithoven avatar peteruithoven commented on August 20, 2024

Works! That's gonna save lot's of milling time.

from jscut.

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.