Defining complex geometries using trimesh Flexcompute (2024)

def create_box(width, height, depth): # create vertices vertices = np.array([ [+width/2, +height/2, +depth/2], # front top right [-width/2, +height/2, +depth/2], # front top left [-width/2, -height/2, +depth/2], # front bottom left [+width/2, -height/2, +depth/2], # front bottom right [+width/2, +height/2, -depth/2], # back top right [-width/2, +height/2, -depth/2], # back top left  [-width/2, -height/2, -depth/2], # back bottom left [+width/2, -height/2, -depth/2] # back bottom right ]) # define faces faces = np.array([ [0,1,2], # front face [0,2,3], [4,6,5], # back face [4,7,6], [0,4,5], # left face [0,5,1], [3,2,6], # right face [3,6,7], [1,5,6], # top face  [1,6,2], [0,3,7], # bottom face [0,7,4] ]) return trimesh.Trimesh(vertices=vertices, faces=faces, process=False)
Defining complex geometries using trimesh Flexcompute (2024)
Top Articles
Latest Posts
Article information

Author: Lilliana Bartoletti

Last Updated:

Views: 5978

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Lilliana Bartoletti

Birthday: 1999-11-18

Address: 58866 Tricia Spurs, North Melvinberg, HI 91346-3774

Phone: +50616620367928

Job: Real-Estate Liaison

Hobby: Graffiti, Astronomy, Handball, Magic, Origami, Fashion, Foreign language learning

Introduction: My name is Lilliana Bartoletti, I am a adventurous, pleasant, shiny, beautiful, handsome, zealous, tasty person who loves writing and wants to share my knowledge and understanding with you.