... | ... | @@ -834,6 +834,32 @@ Creates a mesh from ```shape``` using the marching cubes algorithm. Before calcu |
|
|
|
|
|
### From assets <a name="assets"></a>
|
|
|
|
|
|
``image_contouring(file,pixel_size)```
|
|
|
|
|
|
Extracts contours out of an image file. Returns a table of ```IMGContour``` objects.
|
|
|
* ```file```: input image file (PNG and TGA supported)
|
|
|
* ```pixel_size```: size, in mm, of a pixel
|
|
|
The ```IMGContour``` object has the following members:
|
|
|
* ```outline```: The contour _(table)_
|
|
|
<table>
|
|
|
<tr>
|
|
|
<td>
|
|
|
|
|
|
```lua
|
|
|
contours = image_contouring('shapes.png', 0.1)
|
|
|
for _,contour in pairs(contours) do
|
|
|
emit(linear_extrude_from_oriented(v(0,0,1), contour:outline()))
|
|
|
end
|
|
|
```
|
|
|
|
|
|
</td>
|
|
|
<td>
|
|
|
<img src="uploads/b5334a3f9d84f701e3727957ce6be7b7/Example_image_contouring" width="200">
|
|
|
<img src="uploads/82d378c0e4efb193bb5ea676e305b6b2/shapes.png" width="200">
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
|
|
|
```svg_contouring(file,dpi)```
|
|
|
|
|
|
Extracts contours out of a SVG file. Returns a table of ```SVGContour``` objects.
|
... | ... | |