Development version shape library

Having problems with or questions about SheetCam? Post them here.
David_Lelen01
Posts: 452
Joined: Wed Sep 12, 2018 8:18 pm
Location: South Carolina, USA
Contact:

Development version shape library

Post by David_Lelen01 »

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.
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

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????
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

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?
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: Development version shape library

Post by Les Newell »

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.
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

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
David_Lelen01
Posts: 452
Joined: Wed Sep 12, 2018 8:18 pm
Location: South Carolina, USA
Contact:

Re: Development version shape library

Post by David_Lelen01 »

That doesnt sound too complicated. I will have to try some of our standard shapes later this week as well. Thanks for the info!
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: Development version shape library

Post by Les Newell »

robertspark wrote: Wed Aug 28, 2019 3:04 pmI was wondering if you had a "point" shape for drilling / plasma dimple / plasma centre punch.
If I remember correctly think you can do that with a line of zero length.
luis lopez
Posts: 50
Joined: Sun Nov 24, 2013 12:44 am

Re: Development version shape library

Post by luis lopez »

Hello
It is very interesting, To perform this form as it would be?
Attachments
Captura.PNG
Captura.PNG (4.19 KiB) Viewed 4908 times
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

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")
Les, what did you use for the BMP images (I can obviously create the image easy enough, but what did you use to add the dimension arrows to the BMP easily, thanks)

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
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: Development version shape library

Post by Les Newell »

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.
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

Shape: Convex Rectangle Added, complete with images and code.
shapeCONVEXRECTANGLE.zip
(5.33 KiB) Downloaded 132 times
template.png
template.png (1.09 KiB) Viewed 4876 times
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...
Last edited by robertspark on Fri Aug 30, 2019 12:32 am, edited 4 times in total.
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

Shape: Rectangle, complete with images and code.
shapeRECTANGLE.zip
(4.04 KiB) Downloaded 151 times
Attachments
template.png
template.png (827 Bytes) Viewed 4878 times
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

Shape: Circle, complete with images and code.
shapeCIRCLE.zip
(7.23 KiB) Downloaded 150 times
template.png
template.png (1.76 KiB) Viewed 4875 times
Last edited by robertspark on Mon Sep 02, 2019 1:58 pm, edited 1 time in total.
robertspark
Posts: 257
Joined: Thu Feb 26, 2015 12:11 am

Re: Development version shape library

Post by robertspark »

Shape: TRIANGLE, complete with images and code.
shapeTRIANGLE.zip
(10.06 KiB) Downloaded 154 times
image.png
image.png (1.57 KiB) Viewed 4872 times
luis lopez
Posts: 50
Joined: Sun Nov 24, 2013 12:44 am

Re: Development version shape library

Post by luis lopez »

Thank you very much for your great work.
Could you do the whole library shape?
Post Reply