File size: 902 Bytes
ebc1b3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import FreeCAD as App
import Part

mint = (0.42, 0.66, 0.58)
cream = (0.91, 0.87, 0.77)
coffee = (0.34, 0.21, 0.13)

# Outer mug body.
body = Part.makeCylinder(5.0, 9.0, App.Vector(0, 0, 0))

# Hollow it out from the top.
body = body.cut(
    Part.makeCylinder(4.15, 8.5, App.Vector(0, 0, 0.9))
)

body_obj = Part.show(body, "MugBody")
body_obj.ViewObject.ShapeColor = mint

# Rounded rim.
rim = Part.makeTorus(4.6, 0.45, App.Vector(0, 0, 9.0))
rim_obj = Part.show(rim, "Rim")
rim_obj.ViewObject.ShapeColor = cream

# Coffee surface.
coffee_shape = Part.makeCylinder(4.02, 0.22, App.Vector(0, 0, 8.3))
coffee_obj = Part.show(coffee_shape, "Coffee")
coffee_obj.ViewObject.ShapeColor = coffee

# Handle: a torus turned to sit in the XZ plane.
handle = Part.makeTorus(3.4, 0.9, App.Vector(4.6, 0, 4.6), App.Vector(0, 1, 0))
handle_obj = Part.show(handle, "Handle")
handle_obj.ViewObject.ShapeColor = mint