<p>According to the linked site, it appears that you are missing the &quot;identifier&quot; module for the item to be cut into layers, aka thing();</p>
<blockquote>
<p>module thing() // a random object, in this case a hollow sphere on top
of a hollow cube.</p>
</blockquote>
<p>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.</p>
<p>The second sample in the linked site is a failure similar to your for the same reason.</p>

CC BY-SA 4.0
2023-03-01T16:56:52.360Z
importing within the loop solved the issue for me
Petar Ivcec
CC BY-SA 4.0
2023-03-01T13:47:12.010Z
2023-03-01T13:47:12.010Z
fred_dot_u
<p>I am following the tutorial <a href="https://wiki.makerspaceleiden.nl/mediawiki/index.php/Slicing_a_3D_object_to_SVG" rel="nofollow noreferrer">Slicing a 3D object to SVG</a>.</p>
<p>My code looks like so:</p>
<pre><code>import(&quot;/Users/petarivcec/Desktop/art/king of sun/1.stl&quot;);

 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();
   };
 };
</code></pre>
<p>When I hit <strong>Render</strong>, then I get warnings like:</p>
<p><code>WARNING: Ignoring unknown module 'thing' in file , line 16</code></p>
<p>I guess that I just need to figure out how to run the loop on my imported stl instead of the non-existent <code>thing</code> module which exists in the example code but I'm not really sure.</p>

<openscad>
I am getting an error when trying to slice an STL object into multiple vector files
Petar Ivcec
# I am getting an error when trying to slice an STL object into multiple vector files

(Asked by: username_0 on 2023-03-01)

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.

**Tags:** openscad

---

## 1 answers

### Answer by username_1 on 2023-03-01. Score: 0 | Accepted answer

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.

> **Comments:**
> **username_0**: importing within the loop solved the issue for me  

---

