0
$\begingroup$

I am following the tutorial Slicing a 3D object to SVG.

My code looks like so:

import("/Users/petarivcec/Desktop/art/king of sun/1.stl");

 z_min = 0;
 z_max = 100;
 x_max = 50;
 y_max = 55;
 slice = 1;
 
 n = floor(sqrt((z_max - z_min)/slice)+1);
 for(z = [-z_max:slice:z_min]) { 
   i = (z + z_max) / slice;
   x = x_max * (i % n);
   y = Y_max * floor(i / n);
   translate([x,y,0]) {
       projection(cut=true) 
           translate([0,0,z]) thing();
   };
 };

When I hit Render, then I get warnings like:

WARNING: Ignoring unknown module 'thing' in file , line 16

I guess that I just need to figure out how to run the loop on my imported stl instead of the non-existent thing module which exists in the example code but I'm not really sure.

$\endgroup$

1 Answer 1

0
$\begingroup$

According to the linked site, it appears that you are missing the "identifier" module for the item to be cut into layers, aka thing();

module thing() // a random object, in this case a hollow sphere on top of a hollow cube.

I suspect that if you encase your STL import in a module named thing() you will have a solution. An alternative to naming the module would be to remove the thing() call and use the import at that specific location.

The second sample in the linked site is a failure similar to your for the same reason.

$\endgroup$
1
  • $\begingroup$ importing within the loop solved the issue for me $\endgroup$ Commented Mar 1, 2023 at 16:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .