-
Notifications
You must be signed in to change notification settings - Fork 2
/
shape.lua
36 lines (35 loc) · 2.2 KB
/
shape.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- shape.lua
-- Example of a shape to make
-- Peter Brier
-- Input for revolver.lua
--
-- a shape should select a render methode (currently only vase.render)
-- and set the parameters for the shape
-- * pos {x,y,z} center of the shape
-- * size {w,h,d} size of the shape (in x,y,z direction)
-- * style build style (e.g. styles.pla.highq)
-- * material the material used (e.g. materials.pla.standard3mm)
--
-- other fields are shape type specific
-- for a vase:
-- * contour contour bitmap file name. A binary grayscale ".PGM" image, where black pixels define the left and right side of the contour
-- * texture texture bitmap file name. This is "wrapped" around the shape (horizontal direction=360deg rotation, vertical directions = height)
-- * modulation scalar that is multiplied with the texture intensity value to get the modulation of the radius
-- * modulator a function that returns a radius offset for a give (r,a,z) value where r=radius, a=angle, z=height.
-- for example: modulator = function(r,a,z) return 0.1*z* math.sin(10*a); end;
-- * thickness [mm] constant wall thickness. If not defined, the wall thickness depends on the
-- * min_thickness [mm] Minimal wall thickness. If not defined, "1 shell" is used as minimal wall thickness
shape =
{
render = vase.render; -- the type of shape
material = materials.pla.standard3mm; -- material
style = styles.pla.mediumq; -- build style
size = { width = 30; height = 40; }; -- [mm] width (diameter) and height of the shape
pos = { x = 120; y = 120; z = 0.2; }; -- [mm] center position
-- thickness = 1.0; -- [mm] constant wall thickness (do not define if you want to take inside and outside radius from the image)
min_thickness = 1.0; -- [mm] minimal wall thickness (default is 1 shell)
contour = "square.pgm"; -- the image for the shape
texture = "dots.pgm"; -- the image for the surface
modulation = -1; -- [mm] depth of the surface modulation (0..255 pixel intensity is 0..modulation mm radius change)
-- modulator = function(r,a,z) return 0.1*z* math.sin(7*a); end;
};