Tag Archives: Slicer4RTN

Slicer4RTN

Updates:

  • 2021/09/28: added reference to newly published paper by ZHAW
  • 2021/03/22: 0.4.5: source released on github, page published
  • 2021/03/20: 0.4.2: adding more core slicer examples
  • 2021/03/17: 0.3.1: start writing page, provide overview of settings

Introduction

Slicer4RTN aka “Slicer for Rotating Tilted Nozzle (RTN)” is a highly experimental conic slicer utilizing existing planar slicer like Slic3r with pre- and post-processing to create G-code which can be printed with a 4-axis RTN, allowing to print particular overhangs without support:

Some of the conceptual thoughts on Conic Slicing for Rotating Tilted Nozzle (RTN).

Features

  • conic slicing (rotating tilted nozzle)
    • variable angle of cone
    • single rotation or unlimited rotation
    • printing 90° – 110° overhangs without support, given some conditions
  • unidirectional tilted slicing (tilted nozzle)
    • variable tilt angle
    • printing 90° – 110° overhangs in one direction, like possible with a belt printer

And yes you can print non-planar conic sliced G-code with an ordinary 3-axis 3D printer if you dare, something like this:

Just keep your expectation on the print quality low, as you try to print with a vertical nozzle which is meant to be printed with a tilted nozzle, but you will be able to print 90° overhangs without support structure.

Download

https://github.com/Spiritdude/Slicer4RTN

Usage

% slicer4rtn
USAGE Slicer4RTN 0.4.4: [<opts>] <file.stl> ...
   options:
      -v or --verbose      increase verbosity
      --version            display version and exit
      -k or --keep         keep all temporary files (temp.stl, temp.gcode)
      --recenter           recenter model X- & Y-wise
      --subdivide=<n>      set midpoint subdivisions (default: 2)
      --mode=<mode>        set cone mode, either 'outside' or 'inside' (default: 'outside')
      --output=<fname>     override default naming convention file.stl -> file.gcode
      --axis=<axis>        set axis count of printer: 3, 4 or 5 (default: 4)
      --angle=<angle>      set angle of cone (default: 45)
      --center=<cx,cy>     set conic slicing center (default: 0,0)
      --bed-center=<cx,cy> set bed-enter, only affects output G-code (default: 100,100)
      --layer-height=<z>   set conic layer height (default: 0.2)
      --rot-gcode=<v>      set G-code symbol for rotation (default: A)
      --rot-revolv=<mode>  set rotation revolution, 0 = unlimited, 1 = once (default: 1)
      --rot-offset=<a>     set rotation offset (default: -90)
      --rot-fixed=<angle>  set fixed rotation angle, usable if --axis=3 but 4-axis or 5-axis printer is target
      --tilt-gcode=<v>     set G-code symbol for tilt for 5-axis operation (default: B)
      --zoff=<v>           set z-offset, will be added to G1 ... Z<v>
      --erate=<f>          set extrusion rate (multiplier, default: 1)
      --efmin=<v>          set extrusion factor minimum, (default: 0.01)
      --efmax=<v>          set extrusion factor maximum, (default: 3)
      --inter-steps=<n>    set interpolation steps per mm (default: 2)
      --motion-minz=<v>    set minimum Z level for motion (without extrusion) (default: 0.2)
      --max-speed=<s>      set maximum speed (default: 0)
      --slicer=<slicer>    set slicer (default: 'slic3r')
      --slicer.<k>=<v>     add additional slicer arguments, e.g. --slicer.infill-density=0
      --<k>=<v>            all other arguments not for slicer4rtn will be passed to the core slicer (slic3r)

   examples:
      slicer4rtn sphere.stl
      slicer4rtn overhang.stl --output=sample.gcode
      slicer4rtn overhang.stl --axis=5 --output=sample.gcode
      slicer4rtn overhang.stl --axis=3 --output=sample-belt-printer.gcode --fill-density=5
      slicer4rtn model-6.stl --angle=25 --subdivide=5

Options

subdivide

By default the faces of model is 2x subdivided, you can turn it off by --subdivide=0 or increase like --subdivide=5 for a cube. The current algorithm depends on sufficient detailed faces.

So for simple STLs choose subdivide=5 or higher, for already complex STLs with thousands of faces, you may go with the default.

recenter

If you slice a model you did not create yourself, very likely the model might not be properly aligned or centered, with --recenter you can enforce recentering the model X- and Y-wise.

mode

By default outside mode is used, you may change it with --mode=inside which slices for inside-cone printing. Currently slicer4rtn does not segment parts according their required mode, you have to do this manually right now. This may change with a later version.

Needless to say, this mode switch is very basic and only makes sense for very simple models.

axis

By default G-code for 4-axis Rotating Tilted Nozzle (RTN) is generated (--axis=4), which includes rotational information.

  • --axis=3 generates tilted slices at angle 45° (which can be changed with --angle=..) which means overhangs can only be printed in one direction; the G-code can be printed with a 3-axis 3D printer now like a belt-printer; also --rot-fixed=.. one controls the direction of the tilt slicing
  • --axis=4 is the default, a 45° tilted nozzle is implied
  • --axis=5 adds an additional fixed tilt into the G-code like B45 and is printable on a 5-axis Penta Axis (PAX) printer

angle

By default the conic angle is set to 45° and can be changed with --angle=.., e.g. for a 3-axis 3D printer the angle can be set to 15..25° to print conic slices with a vertical nozzle.

If you plan to print conic sliced overhang pieces on your traditional 3-axis 3D printer, then consult the article on 90° Overhangs without Support Structure with Non-Planar Slicing on 3-axis Printer.

center

By default the conic slicing center is set to 0,0 and can be change with --center=x,y

You control the conic slicing center twofold:

  • with the model itself
  • with --center=cx,cy

You may use --recenter switch to force the model be recentered X- & Y-wise; this is recommended if you did not create the model yourself and the STL is not centered properly.

bed-center

The slicer final output will be offsetted by these coordinates, by default it is 100,100 which should work for most 3D printers.

layer-height

By default 0.2mm conic layer height is set, and can be changed with --layer-height=h [mm]

Note: the layer height for the core slicer is calculated and might exceed the hard limits of the core slicer, so reduce the layer height so that slicer4rtn doesn’t stumble.

rot-gcode

By default the rotational angle is passed to G-code with A and can be changed, e.g. the RotBot uses U in the firmware to process the rotation angle, hence using --rot-gcode=U

rot-revolv

By default the printhead can only revolve once (-180°..180°), hence --rot-revolv=1; a more mechanical complex RTN is the RotBot by ZHAW which permits unlimited rotations with a slip ring, then use --rot-revolv=0

Note: rot-revolv=0 resets at layer change the rotation angle to mod(360) again.

rot-offset

The rotation angle of the tilted nozzle is calculated by the traditional X/Y coordinate system; as I designed my Rotating Tilted Nozzle (RTN) I defined the 0° to be in front, and traditional counter-clockwise with increasing angle; so by default rot-offset is equal -90°.

20mm cube conic sliced, printed with 4/5-axis nozzle, rot-offset=-90 rotation angle A, and tilt angle B shown

rot-fixed

In case you like to have non-rotating printing and single direction slicing therefore, then fix the angle with --rot-fixed=angle.

tilt-gcode

In case when targeting 5-axis Penta Axis (PAX) --axis=5 the tilt G-code is added as default as Bangle, you may change the code with --tilt-gcode=V for example.

erate

In case you have trouble with under- or over-extrusion you can change the multiplier with --erate=f for example to reduce extrusion by 10% use --erate=0.9

inter-steps

By default 2 steps per mm are interpolated per planar G1 extrusion, you may refine it by increasing it, e.g. --inter-steps=4; be aware it creates larger G-code outputs.

slicer

By default Slic3r (slic3r) is used as core slicer, an overview of current supported core slicers, selectable with --slicer=...

  • Slic3r 1.2.9 (slic3r): gives good results so far with minimal configuration ★★★★★
  • Prusa Slicer 2.1.1 (prusa-slicer): struggles to slice inverted conic models and fails to create G-code with a message like Empty layers detected, the output would not be printable. It may help to increase --subdivide=n, be aware of immense amount of faces ★★★★★
  • Mandoline (mandoline): fails mostly to slice inverted conic models, but could become relevant in later development ★★★★
  • CuraEngineLegacy 15.10 (CuraEngineLegacy): outdated but surprisingly gives good results, easy to use on command-line ★★★★★
  • CuraEngine 4.4.1 (CuraEngine): gives good results, but is tedious to configure on command-line as requires base configuration in .json, which changes with each new version; it gives warnings & errors for small polygons but makes an effort regardless giving G-code (good behavior, better than Prusa Slicer) ★★★★
    • Cura CLI Wrapper (cura-slicer): same as CuraEngine but easier to configure (allows to query hundreds of possible settings directly with cura-slicer (recommended)

Example of 20mm cube & overhang nr 3 4mm shown at 50% complete:

Slic3r 1.2.9 performs reliable on 20mm cube and overhang nr 3 4mm model, and CuraEngine 4.4.1 gives excellent results as long layer-height is low (below 0.2), whereas older Cura 3.8.x struggles – so definitely use Cura 4.x series.

G-code Size

As conic slices range over X, Y and Z, the G-code becomes quite verbose compared to horizontal slices, for example 20mm cube sliced both times with Slic3r 1.2.1:

  • horizontal slices: 152 KiB (4.7K G1 lines)
  • conic slices: 7,565 KiB (93.6K G1 lines)

which is a significant increase of 50x size of G-code and 20x more G1 statements.

Common Settings

By default

  • /usr/share/slicer4rtn/slicer4rtn.ini (system-wide) and
  • ~/.config/slicer4rtn/slicer4rtn.ini (user)

are considered where all settings can be listed to provide new defaults for slicer4rtn, for example:

# my own settings:
layer-height = 0.15
bed-center = 120,100
rot-offset = 0
rot-resolv = 0

You can use ‘#‘ as a leading indication that the rest of the line is a comment and disregarded.

Note: It is recommended to only list slicer4rtn specific settings there, not slicer specific settings (see below).

Slicer Specific Settings

Each core slicer may have their own base settings, so you don’t need to add it everytime when calling slicer4rtn, so include them in your user settings:

User Slicer Settings

  • ~/.config/slicer4rtn/slic3r.ini
  • ~/.config/slicer4rtn/prusa-slicer.ini
  • ~/.config/slicer4rtn/mandoline.ini
  • ~/.config/slicer4rtn/CuraEngine.ini
  • ~/.config/slicer4rtn/CuraEngineLegacy.ini
  • ~/.config/slicer4rtn/cura-slicer.ini

Make your changes in those files, as they will not be overwritten when you upgrade slicer4rtn in the future, for example slic3r.ini:

external-perimeter-speed = 10%

Note: slic3r and prusa-slicer directly load their slicer specific settings from the file, whereas the other slicers the settings will be parsed by slicer4rtn and passed on via internal command-line execution.

System-Wide Slicer Settings

By default make install installs some base system-wide configs in /usr/share/slicer4rtn with the same filenames as mentioned above, those will be overwritten in future releases of Slicer4RTN, but your user settings will not be overwritten.

When running slicer4rtn is executed first are the system-wide configs loaded, then the user specifics.

Print3r & Slicer4RTN

As of print3r 0.3.2 or later slicer4rtn is supported as well:

  • .config/print3r/printer/<yourprinter>.ini and make a copy like .config/print3r/printer/<yourprinter>-rtn.ini add following lines:
slicer = slicer4rtn
# slicer4rtn specific seeting prepend 'slicer4rtn.' for settings, like:
# slicer4rtn.slicer = prusa-slicer
angle = 25

and alter the start-gcode line with increasing Z motion as well, e.g for my Prusa-i3 clone it has a M6 threaded rod, which means one revolution (200 full steps) 1mm Z motion, hence

start-gcode = ".....\nM203 Z6\n...."

increased Z motion speed to come close to X- and Y- speed, it creates more even extrusions, nicer prints.

Actual use with print3r goes then like this, my Prusa-i3 clone named y3228-rtn now:

% print3r --printer=y3228-rtn --random-placement print overhang4l4mm.stl
% print3r --printer=y3228-rtn --layer-height=0.3 --fill-density=5 print overhang4l4mm.stl
% print3r --printer=y3228-rtn --scad print 'sphere(10)' --fill-density=5

it slices and forwards the G-code according your setup without the requirement to invoke slicer4rtn manually anymore.

References

See Also

3D Printing: 90° Overhangs without Support Structure with Non-Planar Slicing on 3-axis Printer

Updates:

  • 2021/03/22: slicer4rtn released, see announcement
  • 2021/03/19: some information on use of slicer4rtn (not yet released)
  • 2021/03/09: removed lengthy “Test Protocol” and extended “Gallery” section a bit
  • 2021/03/08: slicer4rtn at 0.2.4 (still unreleased) resulting in better prints, blog-post linked at hackaday
  • 2021/03/05: 95° and 100° overhangs are printable too, more bug-fixes in slicer4rtn
  • 2021/03/04: fixing various bugs in slicer4rtn as disovered printing more complex pieces, supporting prusa-slicer as well aside slic3r, pushing the limits with overhangs
  • 2021/03/02: documenting my findings, a few photos, some early conclusions (not even one day old), conic sliced and tilt sliced.
90° Overhangs without support structure on 3-axis 3D printer

Introduction

It has been target of many efforts to print 90° overhangs without support on 3-axis 3D printers as with ordinary Z slicing, each layer requires a support underneath; hence, every overhang then needs a support structure if the model itself doesn’t provide it.

But if . . . one slices non-planar? That’s what I thought about for a couple of years and kept it in the back of my mind. In January 2021 I came across Rotating Tilted Nozzle (RTN) aka RotBot as developed by ZHAW University of Applied Sciences Zurich (Switzerland). I began to design my own approach of the printhead and then started to code my own conic slicer (slicer4rtn), as the paper which might explain it wasn’t published yet by ZHAW.

While reflecting on the output of the 4-axis conic sliced models, I thought what if I simply make the cone angle flatter than 45° but 15-25° so the vertical nozzle can print it?

Overhang model conic sliced at 25° angle
slicer4rtn --angle=22.5 sliced overhang model, meant for 4-axis printer, but printed on 3-axis printer

Conic Slices Simulation

A simple overhang model (nr 3) conic sliced at 25° for 0.4mm nozzle, 0.2mm layer height:

Tilted Slices Simulation

The same overhang model (nr 3) tilt sliced at 25° for 0.4mm nozzle, 0.2mm layer height (like with belt printer):

Conic Slices Print Tests

And on the afternoon of March 1st 2021 I ran my G-code for the first time on an ordinary 3-axis printer, a cheap CTC DIY I3 Pro B (Prusa-i3 like), in the attempt to print 90° overhangs, with a conic sliced overhang model:

Wow – it seems to have worked! There were still some issues, like the nozzle without extrusion moved into the print as I forgot map linear motions without extrusion also to conic coordinates as well, and some other minor things.

You may consider this a “backport” of 4-axis slicing procedure back to a 3-axis 3D printing procedure.

Next Day Attempts

Conic Slices

The print is still pretty ugly due to the obvious under-extrusion, but the geometry seems to work overall. The overhang on the left-front isn’t evenly, as the outer wall print speed is still too high.

Tilted Slices

Very clean print so far but the overhang is limited to one direction (see below of overall considerations).

Findings

Well, it works, but here are some limitations of using non-planar slicing:

Conic Slices

  • conic sliced overhangs need to be going out- or inward from a central point
    • more complex pieces need to be volume decomposed or segmented, e.g. some sub-volume sliced ordinary vertically Z-wise, others conic sliced where needed – this is part of my research on 4-axis and 5-axis printers; and I was hoping some of the findings can be applied to 3-axis 3D printer as well (as this post shows)
  • the printhead geometry with heatblock sock, part-cooler, LED light they quickly come into way with larger pieces and larger overhangs
    • this might look minor, but part coolers play significant role for quality prints, so they need to be optimized for non-planar printing
  • cone angle
    • 15° works, sufficient space around the nozzle, but on the edge for overhangs, better surface quality
    • 20° works better, layers more stable beneath the overhang
    • 25° works too, but is the limit on my E3D V6 clone, poorer surface quality, but overhang prints better
  • print quality is sub-optiomal, as the nozzle runs over its own extruded filament and any “flat” surface becomes jittery as it’s not longer flat (toward Z) printed

Tilted Slices

  • single direction angled slice like with belt-printer
  • only one direction overhang possible, but good quality
  • tilt angle:
    • 25° works good, yet, the heatblock comes into the way rather quickly with my sample overhang model

Conic vs Tilted Slices

Issues to Resolve

  • more tests
  • more beautiful prints
    • fine tune extrusion rate: the current slicer4rtn does a simple/poor interpolation causing rough top surfaces (under- vs overextrusion)
    • fine tune outer wall of overhangs, slow them down
      • --slicer.external-perimeter-speed=10% (Slic3r)
  • support more slicers
    • Slic3r: supported since slicer4rtn 0.0.1
    • Prusa Slicer: supported since slicer4rtn 0.1.2 (0.1.1 was broken) but often refuses to slice model, e.g. cube fails in inverted cone space
    • Cura Engine: not yet
    • see Conic Slicing for RTN for up-to-date list
  • support skirts (again): due the slicer algorithm the skirt must omitted before pre-processing but be added at last stage or post-processing
  • redesign my part cooler so I can test print larger overhang pieces
  • find collision algorithm (along with given parametric printhead geometry), that’s part of the 4-axis and 5-axis slicing procedure
  • integrate it sub-volume segmenting framework to print complex pieces too

Gallery

2-sided overhang model nr 4 (conic sliced)

Trying out an overhang model which extends -Y and Y (as side-ways the part-cooler comes into the way)

There are still inconsistencies with extrusion calculation, but the prints getting cleaner.

4-sided overhang model nr 6 (conic sliced)

Sample print comes soon as I need to redesign my part cooler so I can print this piece.

1-sided long 4mm thick overhang model nr 3 (conic sliced)

Long 40mm overhang, just 4mm thick extending nose . . .

1-sided long 2mm thick overhang model nr 3 (conic sliced)

Long 40mm overhang, just 2mm thin extending nose, let’s push the limits of what’s possible:

OK print so far, better than anticipated, but still a way to improve it. Reprint with a newer version of slicer4rtn (0.2.3):

  • better surface, no stringing anymore
  • faster print speed but also more geometric inconsistency like bending up
  • underside is more uneven but also cleaner than all the previous (pre- 0.2.0 of slicer4rtn)

1-sided short 2mm thick 95° overhang model nr 3 (conic sliced)

Just trying more overhang, let’s see.

Obviously there is more than 95° overhang possible, so let’s try …

1-sided short 2mm thick 100° overhang model nr 3 (conic sliced)

Even steeper overhang, let’s see.

This is truly promising, up to 100° overhangs printable with vertical nozzle as mounted on most 3-axis 3D printers . . .

Slicer4RTN Settings

As of the publication of this blog-post (2021/03) no slicer is available but slicer4rtn will be made available soon which was released 2021/03/22.

  • Caution: you need to be an experienced 3D printing enthusiast to proceed, you need to know and realize what you do:
    • pay close attention of the printhead geometry, such as the nozzle and heatblock, and the part cooler which limits the non-planar printing
    • depending on the angle, and the direction of extrusion more or less extrusion distortion will occur
Issues to look at when printing conic sliced models with vertical nozzle on a 3-axis 3D printer

  • --angle=20 is a good start, you may go as low as 15°, and perhaps at max at 30° depending on your nozzle and heatblock, if you aim to print 90° overhangs
  • --layer-height=0.2 is a good start too, the thinner the layers the better overhangs can be printed
  • if you have trouble with over- or under-extrusion and your printer otherwise well tuned, then use --erate=f as extrusion-rate tuning, whereas f = 0.5..1.5 or so, if you have to go below or above, something else is wrong.
  • conic slicing is complex(er), you need to think in new terms:
    • the slicing procedure requires a conic slicing center
      • to and from that center overhangs can be printed well
      • if you have multiple centers, slicer4rtn does not yet support volume segmenting to support multiple centers
      • slicer4rtn requires manually entered conic slicing center
    • it requires fine-grained faces so the slicing works well, use --subdivide=5 or higher for simple pieces, e.g. like a cube or low-poly models in generals

Tuning 3-axis 3D Printer

Following changes are recommended:

  • increase Z axis speed: within the start G-code the line M203 Z.. (replace .. with an actual number) to increase speed of Z-axis
    • depending on the pitch of your Z-lead screw or threaded rods, you may set it to Z4, Z6, or higher, so the motion speed comes close to X- and Y-axis to improve print quality
    • if it’s set too high, your stepper motor will block and not move at all
      • my setup with M6 threaded rod for Z (200 full steps = 1mm):
        • M203 Z8, 8mm/s => 8 revolutions/s => 1600 full steps/s: FAILED (blocked motor)
        • M203 Z6, 6mm/s => 6 revolutions/s => 1200 full steps/s: FAILED (stuttering motor at times, mechanical not reliable)
        • M203 Z4, 4mm/s => 4 revolutions/s => 800 full steps/s: OK
        • M203 Z3, 3mm/s -> 3 revolutions/s => 600 full steps/s: OK
    • leadscrew T8x2 (2mm lead per revolution) might support ~12mm/s
    • leadscrew T8x8 (8mm lead per revolution) might support ~50mm/s (ideal, matching X and Y)
  • slow down perimeter (overhangs): use --external-perimeter-speed=20% or a bit more, it prints overhangs better, leave it at 50% if prints look good
  • X- and Y axis speed: try to match your Z speed, so the overall printing is evenly:
    • Slic3r
      • perimeter-speed
      • bridge-speed
      • infill-speed
  • miscellaneous hints:
    • slicer setting solid-infill-below-area = 10 (make infill work at small(er) pieces too)

Models

References

That’s it.

3D Printing: Conic Slicing for Rotating Tilted Nozzle (RTN) / 4 Axis

State: early draft, mostly simulations with a few tests with 3-axis printer only

Conic sliced overhang model with two overhangs, printing with Rotating Tilted Nozzle (RTN) 90° overhang structure without support structure

Updates:

  • 2021/09/28: added reference to paper by ZHAW describing slicing procedure
  • 2021/03/22: slicer4rtn released, see dedicated page Slicer4RTN
  • 2021/03/16: removing details on slicer4rtn as a new dedicated page is in the working (coming soon)
  • 2021/03/08: slicer4rtn 0.2.3 reached (still unreleased), better prints, documenting various settings in more details
  • 2021/03/05: added proper ZHAW reference in the introduction and a few notes
  • 2021/02/27: removed some redundant illustrations and remade some of them, outside-cone vs inside-cone mode & printing
  • 2021/02/26: added inside-cone printing example for inner overhang mode, also early information of slicer4rtn; more animations to observe details of produced G-code, using now also OpenSCAD to simulate G-code and actual nozzle position
  • 2021/02/24: better tests with 20mm cube and overhang structure, included two short G-code simulations as videos, added 20mm sphere and 3D Benchy and discover first issues with volume decomposition and overhang recognition
  • 2021/02/23: first write up, pseudo code and first attempt to conic slice 20mm cube

As I progress I will update this blog-post.

Introduction

The main idea is to utilize existing 3D printing slicers but create conic slices for the Rotating Tilted Nozzle (RTN) 4 Axis Printer. ZHAW published in their announcement in 2021/01 something about utilizing existing slicers, but the details remained concealed and later published as a paper but I did not want to wait and pondered on the problem, and came up with a solution. In its current state it’s purely theoretical and untested for now (2021/02) barely tested yet.

Michael Wüthrich confirmed my solution is comparable with their solution. ZHAW planned their paper to be published sometime 2021. So, the main credit goes to ZHAW and the researchers (Prof. Dr. Wilfried Elspass, Dr. Christian Jaeger, Michael Wüthrich, Maurus Gubser, Philip Bos and Simon Holdener) there, I was just impatient and tried to find a solution with the information available.

I also adapted some of the notions Wüthrich introduced in the Novel 4-Axis 3D Printing Process to Print Overhangs Without Support Material paper, e.g. “outside-cone” and “inside-cone” printing as featured in an earlier blog-post already.

Non-Planar Conic Slices

The 4-axis Rotating Tilted Nozzle (RTN) physical setup implies its slices are of non-planar conic shape, allowing to print overhangs without support structure, such as:

Conic slices of an overhang model

I also like to master the conic slices properly as they promise to become a subset of 5 axis printhead (PAX) features too – so it’s worth the effort even if the RTN itself might be too limited in its application with its fixed tilt – we will see.

Theory

In a nutshell the steps are following:

  1. sub-divide faces of the model (fine-grained)
  2. map model to inverse conic space
  3. send to slicer
  4. remap G-code to conic space
  5. adding Zrot to G-code

Conic Space Mapping

(x1,y1,z1,rot) = conicSpaceMapping(cx,cy,x,y,z,dir);

whereas

  • cx, cy are the conic axis coordinates
  • x, y, z are the input coordinates
  • x1, y1, z1 are the output coordinates
  • rot the rotation angle x,y vs cx,cy
  • dir is either direct (default) or inverse
function conicSpaceMapping(cx,cy,x,y,z,dir='direct') {
   dx = x-cx; 
   dy = y-cy;
   d = sqrt(dx*dx + dy*dy);
   rot = atan2(dy,dx);
   return (x,y,dir=="direct" ? z-d : z+d,rot);
}

Pseudo-Code

The entire procedure goes like this:

m = loadModel("cube.stl");
m = subDivide(m,5);
for(p of m.vertices) {
    m.vertices[i] = conicSpaceMapping(cx,cy,p.x,p.y,p.z,'inverse');
    i++;
}

gcode = sliceModel(m);

foreach(line of gcode) {
   (code,x,y,z,e) = extractCoordsExtrusion(line);
   (x1,y1,z1,zrot) = conicSpaceMapping(cx,cy,x,y,z,'direct');
   outputGcode(code,x1,y1,z1,e,zrot);
}

Note: the pseuco-code is incomplete as extrusion E is not yet taken care of, as soon I found a definitive solution I will write it up.

Examples

I implemented the pseudo-code with some more details like taking care of G-code E extrusion as well and fine-step linear extrusion – here some early tests using OpenSCAD as STL & G-code viewer and Slic3r as actual slicer:

20mm Cube Conic Sliced

Snapshots of progress of conic sliced 20mm cube:

20mm cube conic sliced G-code
20mm cube conic sliced with rotating tilted nozzle simulation

Overhang Conic Sliced

Snapshots of progress of conic sliced Overhang:

Conic sliced overhang model
Conic sliced overhang model including rotating tilted nozzle simulation

Gallery of Conic Sliced Models

Detailed snapshots of overhang nr 3

Detailed snapshots of model nr 6 (table-like)

Some more models with their in-between states, using Cura as model and G-code viewer:

Issues to Resolve

  • test actual G-code in real life
  • find good pre-processing face sub-division strategy
    • in its current form the algorithm requires fine-grained sub-divided faces otherwise inaccurate G-code is created which cannot be recovered
  • slice more complex parts
  • document all details
  • release source code to public

Close-Ups

Some close-ups of conic sliced models:

Outside- vs Inside-Cone Printing

As pointed out in the previous blog-post, the RTN has two main modes of operation, outside-cone and inside-cone printing to cover outside overhangs and inside overhangs – the slicer must recognize those and switch operation mode. Further, these two modes cannot easily be mixed, and need to be segmented or separated, hence speaking of volume segmentation.

This poses significant grow of complexity from just planar slicing, the 4-axis RTN provides features to print 90° overhangs without support structure, but only when the part can be properly analysed and segmented so that those operational mode can be applied.

The difference between inside- and outside-cone printing is to change the order of conic mapping for the model and post slicing:

outside-cone mode

  1. map model inverse conic
  2. slice model
  3. map G-code direct conic

inside-cone mode

  1. map model direct conic
  2. slice model
  3. map G-code inverse conic, Zrot + 180°

Slicer4RTN

The pseudo-code turned into an actual application I named slicer4rtn and is a command-line tool, slicing STL into G-code:

% slicer4rtn --subdivide=5 --recenter cube.stl
== Slicer4RTN 0.4.1 ==
processing 'cube.stl':
   1/5 read stl
      1/5 subdivide (44 vertices)
      2/5 subdivide (188 vertices)
      3/5 subdivide (764 vertices)
      4/5 subdivide (3068 vertices)
      5/5 subdivide (12284 vertices)
   2/5 map vertices
   3/5 write temporary stl
   4/5 slice (slic3r) stl
=> Processing triangulated mesh
=> Generating perimeters
=> Preparing infill
=> Infilling layers
=> Exporting G-code to ./temp-603919.gcode
Done. Process took 0 minutes and 1.362 seconds
Filament required: 710.9mm (5.0cm3)
   5/5 remap gcode to 'cube.gcode' (16214 lines)
== took 3 secs total, done.

I gonna released Slicer4RTN eventually 2021/03/22, in its early version the model currently can only be sliced for outside-cone or inside-cone printing, so the volume decomposition or segmentation needs to be done separately. For now it helps me to verify some of the 4-axis and 5-axis printer designs I work on.

Ashtar K RTN printing conic sliced 20mm cube (close up, animation)
Ashtar K RTN printing conic sliced overhang model without support structure (close up, animation)
Ashtar K RTN printing conic sliced overhang model nr 6 (table-like) without support structure (close up, animation)

Test Prints

As soon I built the RTN printhead on one of my printers I will post photos of the first prints. For now (2021/03) I only printed conic sliced pieces on a 3-axis 3D printer.

References

See Also

With conic sliced G-code there are many first layers . . .

That’s it.