tbfleming / jscut Goto Github PK
View Code? Open in Web Editor NEWIn-browser CAM package
Home Page: http://jscut.org
License: GNU General Public License v3.0
In-browser CAM package
Home Page: http://jscut.org
License: GNU General Public License v3.0
I couldn't find the required settings to configure jscut for laser cutting along the path instead of outside the path.
Currently the drill seems to move to the safety height after finishing a pass before it continues with the next pass (on the same operation). Since the Z axis usually moves very slow this costs a lot of time. Why move to the safety height between passes of the same operation?
I wanted to improve the style of the operations, but changing the html somehow broke the databinding.
My changes:
peteruithoven@f78ad00
What could be wrong?
Hi folks,
In collaboration with the maintainer of the svg.js library I've been able to make it very easy to import and parse svg files. We worked on making importing and converting all shapes to polygons as simple as:
var svg = SVG(containerElement)
svg.svg(importedSVGContent);
svg.toPath(true).toPoly("2px",true);
This imports the contents of a svg file into a svg, converts all shapes (eclipse, rects etc) into path's and then converts all paths into polygons. The import functionality supports Illustrator and Inkscape files. toPoly also subdivides curves into straight lines by a determined sample rate (in this case 2px).
This uses svg.js, import, toPath and toPoly
We still have to work on ungrouping: svgdotjs/svg.js#238
Maybe this is something you can use?
By improving the existing svg.js library and plugins I hope to make it easier for others to build other digital fabrication interfaces, like your jscut.
My personal goal is to use these webbased interfaces for another project: Tosqa
It would be nice if we were able to name the operations when instead of them just being indexed 0 to n-1 . This would allow very easy manual modifications to specific pieces of gcode (when necessary) instead of forgetting the order when looking at the gcode.
I wanted to make a standalone local version of jscut, but it allways fails with the following message:
framlin@bach:~/src/jscut$ make default
cd cpp && em++ cam.cpp hspocket.cpp separateTabs.cpp vEngrave.cpp -I /home/framlin/src/jscut/lib/boost_1_56_0 -std=c++11 --memory-init-file 0 -fcolor-diagnostics -Wall -Wextra -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-logical-op-parentheses -s ASSERTIONS=0 -s ALLOW_MEMORY_GROWTH=1 -s SAFE_HEAP=0 -s DISABLE_EXCEPTION_CATCHING=1 -s FORCE_ALIGNED_MEMORY=1 -s NO_EXIT_RUNTIME=1 -s EXPORTED_FUNCTIONS="['_hspocket', '_separateTabs', '_vPocket']" -o ../js/cam-cpp.js -O3 --llvm-lto 1
[...] some warnings [...]
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in *bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(_self.__args, _self.__kwargs)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 389, in _handle_results
task = get()
TypeError: ('__init() takes at least 3 arguments (1 given)', <class 'subprocess.CalledProcessError'>, ())
any hints, what I could do?
Along with outline and pocket, engraving is a very common type of operation. It is essentially the same thing as outline, just without the tool offset.
Safari on iPad gives up the ghost on jscut now and I don't have a Mac to debug it. Anyone with a Mac handy with a debugger?
Estlcam has an option to do trochoidal milling. This feature would be a great addition to jscut so that we can use techniques to get around machine/bit/spindle limitations to cut more advanced materials.
I am using a Shapeoko 2 with a Due and a gShield running TinyG2. My Z axis is controlled using an ACME threaded rod, where as my XY are controlled by belts and pulleys.
My Z axis on my CNC cannot move at the same rapid speed as my XY axes can. It would be nice if there was an option in jscut to set a Z axis Rapid speed that was separate from the XY Rapid speed.
I have gotten around this issue by setting the rapid speed to a low value, but it's really time consuming to watch the CNC crawl during an XY movement.
Thanks!
Cut Depth still only inch
Margin still only inch
First let me say Iām new to CAM and CNC so I may well have hold of the wrong end of the stick on what the different operations like inside, outside etc do. But I really like the concept of jscut, you have done a great job so far on it! Its great to have something to use from OS/X :-)
Iām using a 3.175mm tool and to try and figure out what happens I made a very simple filled square in inkscape, is 10mm x 10mm and looks like this :
<rect
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.25084114;stroke-miterlimit:3.4000001;stroke-dasharray:none;stroke-opacity:1"
id="rect4710"
width="35.433071"
height="35.433071"
x="3.5433071"
y="1013.3858" />
So I know inkscape is 90 dots per inch (DPI), that means its (90/25.4) dots per mm (DPMM). I can see the width and height is 35.433071 mm. Dividing that by the DPMM the width and height are 10.000000038 mm. So thats as I expect.
I pop that into jscut and ask it to do an inside and this is the relevant bit of GCode :
; cut
G1 X0.0000 Y0.0000 F200
G1 X0.0000 Y7.4917
G1 X7.4917 Y7.4917
G1 X7.4917 Y0.0000
So if we add the Tool width to that its cut will be from -(3.175/2) to 7.4917 + (3.175/2) which is a total cut size of 10.6667mm. That making the square just over 6% larger than I would have expected it to be. Is this just a pile of rounding errors adding up to generate this, or is there something I have done wrong?
Coming from lasercutting applications I though having to manually select elements would be limiting, but I also think it's quite userfriendly. I also think users usually have less parts in their design when they mill something compared to when they lasercut something. But I think I might have found a way to implement a easy mass selection interface that works together with the current selection method.
This panel should start closed.
It would be filled by properties found in the file, grouped under property type.
Selecting a property would select all the parts in a file that match that property. This would allow you to very easily select all red parts for example. This becomes especially interesting when you have a lot of small items you want to do the same thing with, for example turn them into tabs (#17).
It could allow multiple selections.
Properties like colors could have a small preview.
The possible selection could be highlighted in the design when you hover over the properties.
This idea is inspired by VisiCut and this design brainstorm: t-oster/VisiCut#168
Out of curiosity, why not automatically regenerate the path's when configuration is changed?
On my laptop the generation seems almost instant, it would be very nice to have a Auto generate checkbox somewhere. This leaves it as a choice. Users with older computers might not appreciate this.
Web workers, when supported might be interesting for this.
Let's start with the fact that I think your tool is great. I'm involved with a Fablab for years and this is what I and the visitors have been waiting for.
I want to do some small ui improvement suggestions through the issue queue, let me know if that's not okay. I've done the same to help improve VisiCut, which is opensource lasercut control software. See for example: t-oster/VisiCut#71
One thing that's very important with these kind tools is Progressive disclosure. The basic idea is that you only disclosure complexity when it's appropriate, in a progressive way. This keeps it simple for beginners while still have all the tools for powerusers.
A very simple way to implement this in jscut would be to have some less used windows (like Curve To Line Conversion and Gcode Conversion) closed by default. You can even implement some kind of more / less functionality. A quick example:
Hi!
I am currently putting together a Plasma Cutter CNC Machine.
The Controller is an Arduino running GRBL, using grblweb in combination with jscut as a Frontend.
For the Plasma Cutter to work, i Need some Special G-Codes at the beginning of each Path (Probing the Surface, starting the Plasma, moving up a bit, waiting some time, moving a Little down) and also at the end (stopping Plasma, moving a Little up, waiting some time).
The easiest way to achieve this - i think - would be to include a headerfile to the GCode-Output before each path, followed by a footerfile after each path...
What Do you think about that? Could this be possible?
So currently users create and select the current operation in the top left. The options for the selected operation then appear bottom left. Understanding this connection can difficult at first.
My suggestion would be to group this better, maybe have a kind of fold-in, fold-out system. Like a accordion menu, but without the forged limit that only one item can be open.
So users always see the basic options per operation, like it currently shows the Visible, Combine and Operation options. (I would personally skip Combine here.)
Then when the users folds out the operation he sees options like Ramp Plunge, Direction, Cut depth, Margin etc.
A extra feature would be that users could use the scrubbers to drag the operations and change the order.
What do you guys think?
Now, I have raised this on Google Plus with @tbfleming, I have emailed, I see other people have emailed, and I do have sympathy for the author in saying DXFs are a mess.
I do agree it is, but I also do believe that whats standing in the way op opensource CNC the most, is the belief that we can adapt the world to us, instead of the other way around. For many of us to suppport a project, we need to use a project to make money. Reprap got it rights years ago, it creates cashflow for the developers.
This here is the same, we have a army of open source machine owners who can make money out of their garage and in turn plow some it back to the author or other projects
BUT, and thats a big one, most of your 'customers' have Never used Inkcape. CAD has for years been dominated by DXF as the lowest common denominator between CAD/CAD and CAD/CAM. If I want a part made, I send a DXF to the factory and pickup tomorrow. Simple - no questions about dimension or pixels per unit or none of those crap.
Blaming DXF files with disconnected entities is to me a easy way out - and I am not happy with that. We have developers with skills.... The reprap slicer guys have long figured out how to repair STLs on the fly - and thats in 3D, with DXF we have on less dimension so it cant be that hard! We have talented developers like @andrewhodel etc who also has a grasp of this....
Heres what I am thinking:
a) We are looking at the DXF at too high a resolution - most commercial packages just assume if the endpoints are withing 0.1mm of each other they are connected?
b) Adding pre process instructions like "Save as R14 in QCad before opening in JSCut" is completely acceptable
c) TALK about it. Dont just wipe it under the rug as Impossible! We know its not!
I just tried saving the generated gcode to chilipeppr.com, but it says "Not logged into http://chilipeppr.com/" (in an easy-to-miss popup in the background). I just logged into chilipeppr.com (and refreshed both chilipeppr and jscut afterwards), so that cannot be true.
Any thoughts?
jscut is awesome and would be even greater if it could support the inclusion of tags to prevent the piece from floating on the cut table when separated from the raw material.
Ideally it should be possible to add tags manually and hand pick each tag position or they could be part of the svg file as specific elements (discriminated by name or id for instance).
The tags height can be edited as a global parameter.
Add to the renderer the ability to animate the operations at 100% speed or faster.
Since render currently draws at a particular time step, I don't think this would be difficult to achieve. Add some UI elements (a speed slider, Play/Pause, Stop buttons) and set up Timers that set currentTime variable and then draw.
I will attempt to figure out the code-base and create a pull request.
Currently the Print stops at the last X Y position and goes to the safety height. Why not move to X0 Y0 after moving to the safety height? This would make it easier to send another print.
Another one for after #12.
There are quite a few configurations that are in need of a bit of explanation, like Step over, Plunge etc. It would be very nice to have short explanations in some kind of tooltips. Bootstrap seems to have them build in:
I would recommend the popovers, since it's better suited for a bit more text.
With a proper show delay this shouldn't be annoying for power users.
Cura also uses tooltips to explain almost all it's options, I think it's quite useful.
If you guys like it I'd like to help with the texts.
When a shape doesn't have a fill and the line doesn't have a thicker width it's currently hard to select shapes.
Could we find a way to alter the line width so that shapes are easier to click?
Maybe this can be done with css? The following css would give all path, circle, rect etc elements a bigger stroke, when one hovers over them.
svg circle:hover, svg path:hover, svg rect:hover {
stroke-width: 3px;
stroke: #2A6496;
}
First of all, thanks for this software as it is very useful and user-friendly :)
It has been a bunch of times I have got the following error: The amount of passes when creating a cut operation isn't calculated properly.
http://jscut.org/jscut.html?gist=e1f42b8e339a2db06ec8
As you can see (after pressing Generate) the result contains only a single pass.
The problem has appeared with various configurations: Linux & Chrome, Linux & Firefox, Windows & Chrome, etc. I'm sorry as I don't know how to debug the issue. Maybe I am doing something wrong?
Thanks again!!
Just tried on OS X Mavericks (10.9) and Safari 7.0.5 its working until you try to get code or settings. Touching those buttons get you to an URL like this blob:http://jscut.org/24a5e6bc-792c-4ef8-8bac-6f263c100e66 and page not found occurs.
Settings is the same.
May be safari is not yet compliant?
Instead of displaying the file (settings or gcode) by clicking the button Get and then require the user to save the page as a file, it is possible to more directly save files as described here http://updates.html5rocks.com/2011/08/Saving-generated-files-on-the-client-side.
First of all, thanks for all of the hard work on this. jscut really is an awesome app.
The first few times I created an SVG file (with Inkscape) and generated gcode with jscut, it didn't make much sense to me. Y coordinates originate in the upper left, and use negative coordinates while Inkscape appears to use the lower left and positive coordinates. After applying some google-fu, I found out about Inkscape's wonky coordinates/ruler system.
The "set origin to lower left" button doesn't appear to work until after I generate a toolpath. Often the 3D view re-sizes on(during?) regeneration giving the appearance that nothing happened until I export and read the gcode or resize the browser.
In addition, setting the origin to the lower left chooses the leftmost point of a selected object. In the case of a circle, I may not be able to accurately find that point to square my stock in relation to it before milling.
I have a "template" file setup in Inkscape with the page set to the dimensions of my Shapeoko. Since the page size is obvious in Inkscape and tied to X and Y, would it be possible to allow selecting a page corner as the origin? I think asking a user would point out the difference between what Inkscape presents and what it saves in the SVG file, eliminate a lot of initial head scratching, and eliminate a lot of questions on the forums/G+/here, etc.
Working with one positive axis and one negative axis sounds like it will get really confusing while configuring Grbl come homing/limit switch time. Would it be possible to have a selection to convert negative coordinates to positive ones (or an option to just set all coordinates positive or all coordinates negative)?
As a final suggestion, maybe roll all of the XYZ coordinate stuff into a single box and make it an early step?
Thanks for reading this. I hope it makes some sense and I'm not missing something obvious.
I am using JSCut to setup OX CNC gantry plates. The parts are beautiful, and everything is almost perfect. However the fist cut on all the parts is the outside boarder of the part. How can I set it so it does all the holes and pocket cuts inside the part first, the finishes with the outside last?
If the outside is cut first, the clamping is a mute point at the part is now loose for all the rest of the operations. Please tell me how to fix this problem. PS, I love JS cut. Great job!
IE is missing the SVG when it loads this: http://jscut.org/jscut.html?gist=46035293bbcf0fafc224
During the cut of an SVG with fancy writing (both thick and thin lines), the generated gcode caused my spindle to make a lot of slow 3d moves in negative Z space (with top lower left of workpiece as 0,0,0).
It was indeed following the projected path of the text, but as it was far (a few mm) above the workpiece, it was quite the wasted effort.
Need a way to select lines with thickness, and shapes from svg files.
I came across this when exporting from Fritzing, it uses circles and lines to represent pads and traces on pcbs.
Found some resources and made a prototype that converts all shapes/lines to filled paths so I could convert my pcb designs, will try to make a PR after some cleanup:
To "flatten" svg shapes to paths:
https://gist.github.com/timo22345/9413158
To expand unclosed stroked paths/lines to filled paths:
http://microsoft.github.io/maker.js/docs/advanced-drawing/#Outlining%20a%20model
Hello,
Everytime I add tabs to the design I want to cut the generated gcode keeps sending the Z axis to the clearance level before moving it to the next pass depth.
Is there any way to change that ?
I can't get WebGL working in chrome because of some problems with my drivers. Can you please make some simplified version of g-code simulator that would show at least some static 3D views from various angles?
At this point the object you previously selected and created/deleted an operation for becomes un-selectable. It does the same thing if you do it in reverse by using MM prior to creating/deleting the operation then using Make all inch.
Add a license exemption to allow bringing in Google Drive, Dropbox, and Gist. I need help wording this.
I tried to get jscut to play nicely with LinuxCNC a while back, but I didn't know much g-code at the time, and the error message from LinuxCNC wasn't very helpful.
Now I recognize that jscut is leaving off M30 at the end of the file. Adding it manually works fine.
Could this be added by default or as an option?
tocut.svg - http://pastebin.ca/3018586
tocut.gcode - http://pastebin.ca/3018587 (line 780 it goes to Z-12 and cuts, then on line 1157 it again repeats the same process)
This results, especially when cutting sheets, in the object being cut free from the sheet and then the tool making another pass on the same path at the same depth. Unless you are standing there holding the cut out part in place it will ruin the cut.
I'm seeing a lot of people looking over the operation fold-out button. One comment was that next to the generate button it might be confused with a go / play button.
I think there are a few things we can do:
I think option B is better, because the fold button is less grouped with the generate link.
Feedback is welcome.
I'd like to help out with the css / html where needed.
Would it be possible to add V bits?
In the current version, it is not easy to do variable depth cuts using V bits since we're unable to change the tool for the operations.
The following SVG was made in inkscape to be 90x85mm. The versions of inkscape I have tried agree on the size, and Makercam figures it out correctly too (although it spaces the two pieces far apart). However, jscut makes it ~96mm wide.
A browser gives me a pixel-count matching what jscut makes gcode for, but it might be necessary to listen to the specified (The SVG states that it's 90x85mm), as inkscape (which is a quite popular tool for making projected 2D for milling) can apparently not be trusted to output 90px/inch.
Link to SVG: https://www.dropbox.com/s/mzq81jfazikf6ie/spindle-clamp.svg?dl=0
EDIT: On second thought, Makercam uses the input px/inch to compute the size, and gets it wrong if you type the default of 72, instead of inkscapes 90. I'm not entirely sure of what's going on.
It would be useful to be able to be able to reach these files locally as well as on Google Drive (as we can run jscut locally and not just on the web).
Would love to see drilling (straight plunge cuts) as well as spiral path cutting for circular holes larger than the bit diameter.
When trying to select objects the click to select the object in the 'edit toolpaths' view has to be super accurate on the line or the object cant be selected. To select the objects the click has to be right on the line and on my CNC machine the screen is low resolution and I can t get the accuracy needed.
Would it be possible to make the line selection easier when there are simple shapes. To replicate the issue, select display resolution 1024x768 and load up the attached SVG file. Try to select the shapes in the edit toolpaths view. I find myself clicking 20 or so times to just select one path:
rdf:RDF
<cc:Work
rdf:about="">
dc:formatimage/svg+xml/dc:format
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
/cc:Work
/rdf:RDF
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="838"
id="namedview28"
showgrid="false"
inkscape:zoom="1.3664076"
inkscape:cx="242.21269"
inkscape:cy="228.20495"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
When cutting out a rectangle pocket, JSCut generates the following toolpath:
Cutting starts near the middle, with a plunge followed by a fairly long X-axis move. During this move, material is cut away on both sides of the mill bit. Subsequent moves only cut away material on one side of the mill bit, subject to the configured "step over" value.
The problem is that this initial move is a lot more demanding on the mill than the subsequent moves, but they are both executed with the same horizontal cutting speed. This means I have to either lower the cutting speed for the entire cut, or use a faster speed at the risk of things breaking during the initial move.
Is there currently some way to solve this problem? If not, there's two solutions I can imagine (but I'm really a milling novice, so there might well be better solutions here):
It seems that offsets are having problems (see also http://www.shapeoko.com/forum/viewtopic.php?f=6&t=3572&start=40). I use grbl 0.9f with Universal G-Code sender 1.0.7 and setting offsets to 'Zero at lower left' does not seem to work correctly. 'Zero at center' neither.
I'm trying to do a pocket operation on a 100mm x 45mm rectangle created in inkscape exported as SVG. Loading the file and creating the pocket just works.
However, when milling it, the mill moves to coordinated too far away.
Would be great if you could take a look into this as jscut is otherwise really really great :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ššš
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ā¤ļø Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.