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: Rev. Porsche Oberbrunner

Last Updated:

Views: 5738

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.