File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from OCC .Display .SimpleGui import init_display
2+ from OCC .Core .BRepPrimAPI import BRepPrimAPI_MakeBox
3+
4+
5+ def create_box (width , height , depth ):
6+ """
7+ Function to create a 3D box.
8+
9+ Args:
10+ width (float): Width of the box.
11+ height (float): Height of the box.
12+ depth (float): Depth of the box.
13+
14+ Returns:
15+ TopoDS_Shape: The TopoDS shape of the box.
16+ """
17+ # Create a box
18+ box = BRepPrimAPI_MakeBox (width , height , depth ).Shape ()
19+ return box
20+
21+
22+ def main ():
23+ # Initialize the display
24+ display , start_display , add_menu , add_function_to_menu = init_display ()
25+
26+ # Create a box with dimensions 10x20x30
27+ my_box = create_box (10.0 , 20.0 , 30.0 )
28+
29+ # Display the box
30+ display .DisplayShape (my_box , update = True )
31+
32+ # Start the GUI loop
33+ start_display ()
34+
35+
36+ if __name__ == "__main__" :
37+ main ()
You can’t perform that action at this time.
0 commit comments