Superfluous travel when creating gcode

Hello there,

I’m learning how to create gcode and have an issues when doing more complex model than a square shape. I read the book ‘’ Advanced 3D printing with Grasshopper, clay and FDM. by Diego Garcia Cuevas and Gianluca Pugliese. I used what I learn to create the gcode but with more complex shape I have superfluous travel when it shouldn’t have some. The model I have trouble I a bench, the shape is closed and shouldn’t have travel through the body.

What should I modify to get a clean polyline doing the contour?

Bench.3dm (668.0 KB)
Base gcode creation.gh (11.8 KB)

I can’t check your files at the moment but sometimes this strange travel can be caused by arcs. An arc is part of a circle and I’ve seen gcode get the wrong arc… I.e. instead of the short arc it tries to move along the long arc.
Other weird movements can be caused translating nurbs curves to lines and arcs.

there are two things going on, the first one is your initial Brep has a weird bottom surface, and Contouring it generates 2 section curves (a closed curve and an Arc)

I’d suggest to rework your brep by deleting the bottom surface, Cap holes, and once it’s a closed Solid again re-reference it in GH:

in the attached GH file I have done it for you, but it’s a step I’d advice to also try to do on your own, in such a way to get used to it :+1:

the second point is about curve Seams: seam of a closed curve is where its Start/end point is, sometimes curve start/end in different locations, so when you move from one layer to the next one, the end point of the previous curves connects to the start point of the next curve and this might happen:

that depends mainly on the topology of your Brep, on how many different surfaces it’s made of ecc etc, it’s something you will deal a lot with 3D printing custom shapes

best way to accomodate this is to use the Seam component, and move the “stitching” all on one location (usually with Curve Closest Point) for instance, I define this external point P as location where I want all the curves to start/end:

then you can use the t value with the Seam component to redefine the curve seam:

by doing so, check the Polyline from top view, no more crossing :+1:

Base gcode creation_inno.gh (192.8 KB)

3 Likes

Thank you inno! Greatly appreciated!