- Oriented Bounding Box - COMPAS

文章推薦指數: 80 %
投票人數:10人

_images/oriented-bounding-box.png. from math import radians from compas.geometry import Pointcloud, Box from compas.geometry import Rotation from ... docs OrientedBoundingBox OrientedBoundingBox frommathimportradians fromcompas.geometryimportPointcloud,Box fromcompas.geometryimportRotation fromcompas.geometryimportoriented_bounding_box_numpy fromcompas_view2.appimportApp cloud=Pointcloud.from_bounds(10,5,3,100) Rz=Rotation.from_axis_and_angle([0.0,0.0,1.0],radians(60)) Ry=Rotation.from_axis_and_angle([0.0,1.0,0.0],radians(20)) Rx=Rotation.from_axis_and_angle([1.0,0.0,0.0],radians(10)) cloud.transform(Rz*Ry*Rx) bbox=oriented_bounding_box_numpy(cloud) box=Box.from_bounding_box(bbox) viewer=App() viewer.add(cloud) viewer.add(box,show_faces=False,linecolor=(1,0,0),linewidth=3) viewer.run() MeshBooleans MeshSubdivisionSchemes MeshCreasedCatmull-Clark MeshFromHalfspaces OrientedBoundingBox PointInBox MeshDuals NetworkShortestPath MeshSplitting Conwayoperators TrimeshRemesh RobotMotionwithRRC BasicStructuralAssembly-GMSH TransportingaBoxAlongaCurve COMPAS Acomputationalframeworkforcollaborationandresearch inArchitecture,Engineering,Fabrication,andConstruction. Copyright©2017-2021compas-dev



請為這篇文章評分?