Development version shape library
-
- Posts: 452
- Joined: Wed Sep 12, 2018 8:18 pm
- Location: South Carolina, USA
- Contact:
Development version shape library
Is there a database available to download any more standard shapes for the shape library in the development version? The only shapes i have are Pipe flange, 4 hole rectangle, multi-hole rectangle, and triangular gusset.
If not, what tips do you have for making more shapes? I'd like to give it a try.
If not, what tips do you have for making more shapes? I'd like to give it a try.
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Les I'd be interested in this too as I've got a load of standard shapes that I'm looking to add to a shape library.... just not sure how .... I do have some (better than average ,,) lua, c# c, c++ experience
are they added in DXF, gcode????
are they added in DXF, gcode????
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Les I had a look at the 4 shape files and they made sense
given all the entities in gcode are either arcs, lines or circles I guess there are no more shapes to define
but question.... i can see why it would be slow to programme the code by hand.... but I am wondering if a modified and simplified gcode file could do some of the conversion..... then all that would be required would be to hand code the variables
is there any easier way?
given all the entities in gcode are either arcs, lines or circles I guess there are no more shapes to define
but question.... i can see why it would be slow to programme the code by hand.... but I am wondering if a modified and simplified gcode file could do some of the conversion..... then all that would be required would be to hand code the variables
is there any easier way?
- Les Newell
- Site Admin
- Posts: 3670
- Joined: Thu May 11, 2006 8:12 pm
Re: Development version shape library
I really need to put some more time into this.
Robert, the basic primitives used in the shape files are lines arcs and circles but doing that with g-code would be a bit of a pain. All of the shapes are parametric. For example in the pipe flange example you can define the number of holes. While something like this could be done in g-code it would quickly get complicated. G-code isn't the most intuitive programming language for parametric stuff. It would also mean adding a g-code interpreter to convert that code to something SheetCam can understand.
To be honest most of the time spent creating shapes is in drawing the graphics. Programming shapes doesn't normally take that long.
If you want to create your own shapes the shape functions are:
Circle(x, y, diameter)
Line(x1,y1,x2,y2) Line from x1,y1 to x2,y2
MoveTo(x,y) Set current position
LineTo(x,y) Line from current position to x,y
ArcA(startX, startY, centerX, centerY, angle) Note angle is in radians. Positive values are clockwise.
Robert, the basic primitives used in the shape files are lines arcs and circles but doing that with g-code would be a bit of a pain. All of the shapes are parametric. For example in the pipe flange example you can define the number of holes. While something like this could be done in g-code it would quickly get complicated. G-code isn't the most intuitive programming language for parametric stuff. It would also mean adding a g-code interpreter to convert that code to something SheetCam can understand.
To be honest most of the time spent creating shapes is in drawing the graphics. Programming shapes doesn't normally take that long.
If you want to create your own shapes the shape functions are:
Circle(x, y, diameter)
Line(x1,y1,x2,y2) Line from x1,y1 to x2,y2
MoveTo(x,y) Set current position
LineTo(x,y) Line from current position to x,y
ArcA(startX, startY, centerX, centerY, angle) Note angle is in radians. Positive values are clockwise.
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
thanks Les, I'll have a go and publish any I do to get a feel for doing the easy ones first
I was wondering if you had a "point" shape for drilling / plasma dimple / plasma centre punch.
something to have a play with in the evening
I was wondering if you had a "point" shape for drilling / plasma dimple / plasma centre punch.
something to have a play with in the evening
-
- Posts: 452
- Joined: Wed Sep 12, 2018 8:18 pm
- Location: South Carolina, USA
- Contact:
Re: Development version shape library
That doesnt sound too complicated. I will have to try some of our standard shapes later this week as well. Thanks for the info!
- Les Newell
- Site Admin
- Posts: 3670
- Joined: Thu May 11, 2006 8:12 pm
Re: Development version shape library
If I remember correctly think you can do that with a line of zero length.robertspark wrote: ↑Wed Aug 28, 2019 3:04 pmI was wondering if you had a "point" shape for drilling / plasma dimple / plasma centre punch.
-
- Posts: 50
- Joined: Sun Nov 24, 2013 12:44 am
Re: Development version shape library
Hello
It is very interesting, To perform this form as it would be?
It is very interesting, To perform this form as it would be?
- Attachments
-
- Captura.PNG (4.19 KiB) Viewed 5212 times
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Code: Select all
-- SHAPE NAME: CONVEX RECTANGLE
shape = {}
function shape.Calculate()
local hw = shape.width / 2
local hh = shape.height / 2
Line(-hw, hh, -hw, -hh)
Line(-hw, -hh, hw, -hh)
Line(hw, -hh, hw, hh)
ArcA(hw, hh, 0, hh, -math.pi)
end
AddNumControl("width", "Width", sc.unitLINEAR, 100, 0.1, 10000, "width.png")
AddNumControl("height", "Height", sc.unitLINEAR, 150, 0.1, 10000, "height.png")
I use autocad, but have a of other forms of CAD / image editing available (freeCAD, LibreCAD, Inkscape, GIMP, photoshop, illistrator .... jus looking to not reinvent that wheel / path which is well trodden.... thanks
- Les Newell
- Site Admin
- Posts: 3670
- Joined: Thu May 11, 2006 8:12 pm
Re: Development version shape library
I used a cad package that is very old and as far as I know it's no longer available. To be honest, it's not that great for this job but I'm used to using it.
The images aren't required. If you leave the icon file name empty everything else will still work.
The images aren't required. If you leave the icon file name empty everything else will still work.
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Shape: Convex Rectangle Added, complete with images and code.
Instructions:
Create a new folder within the
C:\Program Files (x86)\SheetCam TNG Development\plugins\shape\shapes\
folder..... Say something like "Simple" (you can call it anything you want)
Within that folder, add a second folder
say "Convex Rectangle" (Again, you can call it anything you want, but I have decided to try to use the Hypertherm Edge / Phoenix Plasma Shapes names.... as the variables will probably similar)... each to their own, do what you want / makes sense to you
https://www.google.com/url?sa=t&rct=j&q ... 345VjGTW3U
PDF Page 177/317 (onwards)
Within that folder unzip the contents of the attached Zip folder which is:
main.lua (the shape code file)
template.pdn (Paint.Net primary file)
template.png (sheetcam extracted PNG by saving "BMP" actually... it saves a PNG for use to add dimension lines too.... image is 32bit (i.e. has a trasnparent Alpha background and is 128x128pixels)
width.png (the template image with a "width" arrow added in Paint.Net)
height.png (the template image with a "height" arrow added in Paint.Net)
Info to create your own images (i am a perfectionist)
After fiddling around with Inkscape, GIMP and a few icon type pixel editors to add some simple arrows to the template (PNG) file that Sheetcam creates for you when you press the "Create bitmap" button I found that Paint.Net is by far the easiest (most idiot proof for me).
https://www.getpaint.net/
basically I just added some straight "dimension lines" (change line style to arrows at both ends https://www.getpaint.net/doc/latest/LineCurveTool.html) to the image on two different layers (if you need more dims then I would add more layers, as the layers allow you to select the background and the layer of concern "Save As" >PNG and you're done...
Create a new folder within the
C:\Program Files (x86)\SheetCam TNG Development\plugins\shape\shapes\
folder..... Say something like "Simple" (you can call it anything you want)
Within that folder, add a second folder
say "Convex Rectangle" (Again, you can call it anything you want, but I have decided to try to use the Hypertherm Edge / Phoenix Plasma Shapes names.... as the variables will probably similar)... each to their own, do what you want / makes sense to you
https://www.google.com/url?sa=t&rct=j&q ... 345VjGTW3U
PDF Page 177/317 (onwards)
Within that folder unzip the contents of the attached Zip folder which is:
main.lua (the shape code file)
template.pdn (Paint.Net primary file)
template.png (sheetcam extracted PNG by saving "BMP" actually... it saves a PNG for use to add dimension lines too.... image is 32bit (i.e. has a trasnparent Alpha background and is 128x128pixels)
width.png (the template image with a "width" arrow added in Paint.Net)
height.png (the template image with a "height" arrow added in Paint.Net)
Info to create your own images (i am a perfectionist)
After fiddling around with Inkscape, GIMP and a few icon type pixel editors to add some simple arrows to the template (PNG) file that Sheetcam creates for you when you press the "Create bitmap" button I found that Paint.Net is by far the easiest (most idiot proof for me).
https://www.getpaint.net/
basically I just added some straight "dimension lines" (change line style to arrows at both ends https://www.getpaint.net/doc/latest/LineCurveTool.html) to the image on two different layers (if you need more dims then I would add more layers, as the layers allow you to select the background and the layer of concern "Save As" >PNG and you're done...
Last edited by robertspark on Fri Aug 30, 2019 12:32 am, edited 4 times in total.
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Shape: Rectangle, complete with images and code.
- Attachments
-
- template.png (827 Bytes) Viewed 5182 times
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Shape: Circle, complete with images and code.
Last edited by robertspark on Mon Sep 02, 2019 1:58 pm, edited 1 time in total.
-
- Posts: 257
- Joined: Thu Feb 26, 2015 12:11 am
Re: Development version shape library
Shape: TRIANGLE, complete with images and code.
-
- Posts: 50
- Joined: Sun Nov 24, 2013 12:44 am
Re: Development version shape library
Thank you very much for your great work.
Could you do the whole library shape?
Could you do the whole library shape?