GeezerVison is showing github.com — Fixed wrong asset path · hovedguy/pythonocc-demos@f5060c1
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: examples/core_display_background_image.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | display, start_display, add_menu, add_function_to_menu = init_display() | 22 | 22 | my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape() | 23 | 23 |
| 24 | | -display.SetBackgroundImage('./images/nevers-pont-de-loire.jpg', stretch=True) | | 24 | +display.SetBackgroundImage('../assets/images/nevers-pont-de-loire.jpg', stretch=True) | 25 | 25 | display.DisplayShape(my_box, update=True) | 26 | 26 | start_display() |
Collapse file Copy file name to clipboardExpand all lines: examples/core_display_camera_projection.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 27 | 27 | # loads the motor model | 28 | 28 | motor_c = TopoDS_Shape() | 29 | 29 | builder = BRep_Builder() | 30 | | -breptools_Read(motor_c, './models/Motor-c.brep', builder) | | 30 | +breptools_Read(motor_c, '../assets/models/Motor-c.brep', builder) | 31 | 31 | display.DisplayShape(motor_c, update=True) | 32 | 32 |
| 33 | 33 | def perspective(event=None): | |
Collapse file Copy file name to clipboardExpand all lines: examples/core_display_clip_planes.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 34 | 34 |
| 35 | 35 | cylinder_head = TopoDS_Shape() | 36 | 36 | builder = BRep_Builder() | 37 | | -breptools_Read(cylinder_head, './models/cylinder_head.brep', builder) | | 37 | +breptools_Read(cylinder_head, '../assets/models/cylinder_head.brep', builder) | 38 | 38 |
| 39 | 39 | ais_shp = display.DisplayShape(cylinder_head).GetObject() | 40 | 40 |
| |
Collapse file Copy file name to clipboardExpand all lines: examples/core_display_overlayered_image.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 29 | 29 |
| 30 | 30 | def absolute_position(event=None): | 31 | 31 | # create a texture | 32 | | - aTextureItem = TextureItem(TCollection_AsciiString("./images/carre-200.png"), | | 32 | + aTextureItem = TextureItem(TCollection_AsciiString("../assets/images/carre-200.png"), | 33 | 33 | display.GetView().GetObject(), | 34 | 34 | display.GetOverLayer()) | 35 | 35 | aTextureItem.SetAbsolutePosition(50, 50) | @@ -38,7 +38,7 @@ def absolute_position(event=None): | 38 | 38 |
| 39 | 39 | def relative_position(event=None): | 40 | 40 | # create a texture | 41 | | - aTextureItem = TextureItem(TCollection_AsciiString("./images/carre-200.png"), | | 41 | + aTextureItem = TextureItem(TCollection_AsciiString("../assets/images/carre-200.png"), | 42 | 42 | display.GetView().GetObject(), | 43 | 43 | display.GetOverLayer()) | 44 | 44 | aTextureItem.SetRelativePosition(30, 60) # 30% width, 60% width | |
Collapse file Copy file name to clipboardExpand all lines: examples/core_display_point_cloud.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -48,7 +48,7 @@ def random_points(event=None): | 48 | 48 | display.FitAll() | 49 | 49 |
| 50 | 50 | def bunny(event=None): | 51 | | - pcd_file = open(os.path.join('models', 'bunny.pcd'), 'r').readlines()[10:] | | 51 | + pcd_file = open(os.path.join('..', 'assets', 'models', 'bunny.pcd'), 'r').readlines()[10:] | 52 | 52 | # create the point_cloud | 53 | 53 | pc = Graphic3d_ArrayOfPoints(len(pcd_file)) | 54 | 54 | for line in pcd_file: | |
Collapse file Copy file name to clipboardExpand all lines: examples/core_display_textured_shape.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -63,7 +63,7 @@ def GetProperties(self): | 63 | 63 | # | 64 | 64 | # First create texture and a material | 65 | 65 | # | 66 | | -texture_filename = './images/ground.bmp' | | 66 | +texture_filename = '../assets/images/ground.bmp' | 67 | 67 | t = Texture(texture_filename) | 68 | 68 | m = Graphic3d_MaterialAspect(Graphic3d_NOM_SILVER) | 69 | 69 | # | |
Collapse file Copy file name to clipboardExpand all lines: examples/core_export_stl.py +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 | my_torus = BRepPrimAPI_MakeTorus(20., 10.).Shape() | 25 | 25 |
| 26 | 26 | # set the directory where to output the | 27 | | -directory = os.path.split(__name__)[0] | 28 | | -stl_output_dir = os.path.abspath(os.path.join(directory, "models")) | | 27 | +stl_output_dir = os.path.abspath(os.path.join("..", "assets", "models")) | 29 | 28 |
| 30 | 29 | # make sure the path exists otherwise OCE get confused | 31 | 30 | assert os.path.isdir(stl_output_dir) | |
Collapse file Copy file name to clipboardExpand all lines: examples/core_font_register.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 | display, start_display, add_menu, add_function_to_menu = init_display() | 25 | 25 |
| 26 | 26 | # register the Respective font | 27 | | -register_font(os.path.join('.', 'fonts', 'Respective.ttf')) | | 27 | +register_font(os.path.join('..', 'assets', 'fonts', 'Respective.ttf')) | 28 | 28 |
| 29 | 29 | # text | 30 | 30 | # Poetry from Paul Verlaine, Chanson d'Automne | |
Collapse file Copy file name to clipboardExpand all lines: examples/core_geometry_face_recognition_from_stepfile.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -128,7 +128,7 @@ def exit(event=None): | 128 | 128 | display.SetSelectionModeFace() # switch to Face selection mode | 129 | 129 | display.register_select_callback(recognize_clicked) | 130 | 130 | # first loads the STEP file and display | 131 | | - shp = read_step_file(os.path.join('.', 'models', 'face_recognition_sample_part.stp')) | | 131 | + shp = read_step_file(os.path.join('..', 'assets', 'models', 'face_recognition_sample_part.stp')) | 132 | 132 | display.DisplayShape(shp, update=True) | 133 | 133 | add_menu('recognition') | 134 | 134 | add_function_to_menu('recognition', recognize_batch) | |
Collapse file Copy file name to clipboardExpand all lines: examples/core_geometry_geomplate.py +2-5Lines changed: 2 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -278,11 +278,8 @@ def build_curve_network(event=None): | 278 | 278 | mimic the curve network surfacing command from rhino | 279 | 279 | ''' | 280 | 280 | print('Importing IGES file...') | 281 | | - pth = os.path.dirname(os.path.abspath(__file__)) | 282 | | - pth = os.path.abspath( | 283 | | - os.path.join(pth, 'models', 'curve_geom_plate.igs')) | 284 | | - iges = read_iges_file(pth) | 285 | | - print(iges) | | 281 | + iges_file = os.path.join('..', 'assets', 'models', 'curve_geom_plate.igs') | | 282 | + iges = read_iges_file(iges_file) | 286 | 283 |
| 287 | 284 | print('Building geomplate...') | 288 | 285 | topo = TopologyExplorer(iges) | |
|