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.
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???
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?
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.
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
That doesnt sound too complicated. I will have to try some of our standard shapes later this week as well. Thanks for the info!
If I remember correctly think you can do that with a line of zero length.
Hello
It is very interesting, To perform this form as it would be?
-- 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
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.
Shape: Convex Rectangle Added, complete with images and code.
shapeCONVEXRECTANGLE.zip (5.33 KB)
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=&esrc=s&source=web&cd=17&ved=2ahUKEwi716D5o6nkAhUGesAKHfUbCx8QFjAQegQIBxAC&url=https%3A%2F%2Fwww.hypertherm.com%2FDownload%3FfileId%3DHYP111796&usg=AOvVaw0AVsCRMJBImy345VjGTW3U
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).
basically I just added some straight “dimension lines” (change line style to arrows at both ends Line/Curve Tool) 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…
Shape: Rectangle, complete with images and code.
shapeRECTANGLE.zip (4.04 KB)
Shape: Circle, complete with images and code.
shapeCIRCLE.zip (7.23 KB)
Shape: TRIANGLE, complete with images and code.
shapeTRIANGLE.zip (10.1 KB)
Thank you very much for your great work.
Could you do the whole library shape?
haha… I’ll try or see how far I get…
Les the shape dialog, is there a way I can make it bigger, I’ve had a look at the xrc files (in notepad++), but I didn’t see a form size setting (or it wasn’t apparent to me)
do you think there may be a way to change this list to a form with PNG images that are clickable?
it may be a bit more of a user friendly GUI (in my opinion)… do I need to look at wxWidgets?
I have attached an update that has a bigger dialog and you can resize it. If your shape directory contains a file called ‘icon.png’ it will be used as an icon for that shape. Put the contents of the zip file in your shape plugin directory.
update.zip (2.23 KB)
thanks Les very much, I’ll have a play tonight / weekend
Les,
That works great
Bit of a suggestion {some people are never happy… haha}
When you first select the shape and it appears on the screen, it may be useful (for asthetics … no other reason) for the shape (icon.png) to appear in the location where the dimensions shapes appear. Given its already within the file there is no object creation overhead to doing this in my opinion… but it makes it look nice and finishes it off as a selection confirmation.
That shouldn’t be a problem. I’ll take a look on Monday.