MCPcopy
hub / github.com/a1studmuffin/SpaceshipGenerator / get_aspect_ratio

Function get_aspect_ratio

spaceship_generator.py:117–123  ·  view source on GitHub ↗
(face)

Source from the content-addressed store, hash-verified

115
116# Returns the rough aspect ratio of a face. Always >= 1.
117def get_aspect_ratio(face):
118 if not face.is_valid:
119 return 1.0
120 face_aspect_ratio = max(0.01, face.edges[0].calc_length() / face.edges[1].calc_length())
121 if face_aspect_ratio < 1.0:
122 face_aspect_ratio = 1.0 / face_aspect_ratio
123 return face_aspect_ratio
124
125# Returns true if this face is pointing behind the ship
126def is_rear_face(face):

Callers 2

add_exhaust_to_faceFunction · 0.85
generate_spaceshipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected