pycg.vis
vis module is intended for fast creation and visualizing 3D assets for debugging and demonstrations.
It is a shallow warpper of Open3D, with a more intuitive interface.
Functions in this module are divided into two categories: asset functions that return drawable 3D instance, and utility functions that do some jobs.
The following visualization could be achieved under few lines of PyCG code, please refer to examples/ directory on how it could be used.
Asset functions
Legend: 🐬 - supports batched values with shape (N, 3), meaning you can create multiple instances at a time.
vis.transparent(geom): return a transparent version ofgeom.vis.text(text): return a 3D geometry (could be either mesh or point cloud) displayingtext.vis.pointflow(src, flow, dst): visualize 3D scene flow fromsrctodst, with scene flow beingflow.vis.frame(iso): return a coordinate frame with poseiso.vis.camera(iso): return a camera frustum geometry with poseiso.vis.arrow(base, target): 🐬 return 3D arrows pointing frombasetotarget.vis.pointcloud(pc): return a point cloud, normal, color, ... could be provided as additional arguments.vis.mesh(v, f): return a triangle mesh.vis.wireframe(bottom_pos, top_pos): 🐬 return a bounding box ranging frombottom_postotop_pos.
Utility functions
vis.show_3d([geom_a, geom_b], [geom_c, geom_d], ...): display two windows (cameras are synchronized), one window withgeom_aandgeom_b, the other window showinggeom_candgeom_d. The return values are tworender.Sceneobject, where you could render to a numpy image (e.g. using blender) by simply calling.render_blender().vis.from_file(path): load geometry frompath.vis.to_file(geom, path): savegeomtopath.