-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
cuboctahedron.obj
59 lines (56 loc) · 1.67 KB
/
cuboctahedron.obj
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#===============================================================================
# Cuboctahedron centered at origin with edge length sqrt(2) and width of 2.0.
# It fits inside the cube [-1,+1]^3. It has 6 square faces (same as a cube), and
# 8 triangular faces (same as an octahedron). It is a hybrid between a cube and
# an octahedron. Every face has edges of the same length sqrt(2).
#===============================================================================
# 12 coordinates generated by:
# step 1. assign coordinate c = x, y, or z to be 0 (3 choices)
# step 2. remaining two coordinates are the extrema -1 or +1 (2x2 = 4 choices)
# 3 (step 1) x 4 (step 2) = 12 choices
# ( x, y, z)
# ( 0, +-1, +-1)
# (+-1, 0, +-1)
# (+-1, +-1, 0)
#
# These points are the midpoints of the 12 edges of the bounding cube [-1,+1]^3.
# x=0 y=+-1 z=+-1
v 0 -1 -1 # 1
v 0 -1 1 # 2
v 0 1 -1 # 3
v 0 1 1 # 4
# x=+-1 y=0 z=+-1
v -1 0 -1 # 5
v -1 0 1 # 6
v 1 0 -1 # 7
v 1 0 1 # 8
# x=+-1 y=+-1 z=0
v -1 -1 0 # 9
v -1 1 0 # 10
v 1 -1 0 # 11
v 1 1 0 # 12
#===============================================================================
# 6 square faces + 8 triangular faces.
#===============================================================================
#
# Each diamond square is on each face of the bounding cube [-1,+1]^3
#
f 5 10 6 9
f 7 12 8 11
f 1 11 2 9
f 3 12 4 10
f 1 7 3 5
f 2 8 4 6
#
# We have 8 triangular faces. One triangle for each vertex of the cube [-1,1]^3.
# step 1. pick one corner (+-1, +-1, +-1) of the cube
# step 2. replace one of the x,y,z by 0 to get 3 vertices of the triangle
#
f 1 5 9
f 2 6 9
f 3 5 10
f 4 6 10
f 1 7 11
f 2 8 11
f 3 7 12
f 4 8 12