GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fixed wrong asset path · hovedguy/pythonocc-demos@f5060c1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • examples
    • core_display_background_image.py
    • core_display_camera_projection.py
    • core_display_clip_planes.py
    • core_display_overlayered_image.py
    • core_display_point_cloud.py
    • core_display_textured_shape.py
    • core_export_stl.py
    • core_font_register.py
    • core_geometry_face_recognition_from_stepfile.py
    • core_geometry_geomplate.py
    • core_geometry_splinecage.py
    • core_load_brep.py
    • core_load_iges.py
    • core_load_step_ap203.py
    • core_load_step_ap203_ocaf.py
    • core_load_step_with_colors.py
    • core_load_stl.py
    • core_mesh_fast_stl_load.py
    • core_parallel_slicer.py
    • core_visualization_3d_to_2d_screen_coordinates.py
    • core_visualization_camera.py
    • core_webgl_x3dom_cylinderhead.py
  • jupyter_notebooks
    • occ_load_brep.ipynb
    • occ_load_step_ap203_multiple_shapes.ipynb
    • occ_load_step_ap203_one_shape.ipynb
    • occ_triangle_mesh_gmsh.ipynb
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎examples/core_display_background_image.py‎

Copy file name to clipboardExpand all lines: examples/core_display_background_image.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
display, start_display, add_menu, add_function_to_menu = init_display()
2222
my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape()
2323

24-
display.SetBackgroundImage('./images/nevers-pont-de-loire.jpg', stretch=True)
24+
display.SetBackgroundImage('../assets/images/nevers-pont-de-loire.jpg', stretch=True)
2525
display.DisplayShape(my_box, update=True)
2626
start_display()
Collapse file

‎examples/core_display_camera_projection.py‎

Copy file name to clipboardExpand all lines: examples/core_display_camera_projection.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# loads the motor model
2828
motor_c = TopoDS_Shape()
2929
builder = BRep_Builder()
30-
breptools_Read(motor_c, './models/Motor-c.brep', builder)
30+
breptools_Read(motor_c, '../assets/models/Motor-c.brep', builder)
3131
display.DisplayShape(motor_c, update=True)
3232

3333
def perspective(event=None):
Collapse file

‎examples/core_display_clip_planes.py‎

Copy file name to clipboardExpand all lines: examples/core_display_clip_planes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
cylinder_head = TopoDS_Shape()
3636
builder = BRep_Builder()
37-
breptools_Read(cylinder_head, './models/cylinder_head.brep', builder)
37+
breptools_Read(cylinder_head, '../assets/models/cylinder_head.brep', builder)
3838

3939
ais_shp = display.DisplayShape(cylinder_head).GetObject()
4040

Collapse file

‎examples/core_display_overlayered_image.py‎

Copy file name to clipboardExpand all lines: examples/core_display_overlayered_image.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
def absolute_position(event=None):
3131
# create a texture
32-
aTextureItem = TextureItem(TCollection_AsciiString("./images/carre-200.png"),
32+
aTextureItem = TextureItem(TCollection_AsciiString("../assets/images/carre-200.png"),
3333
display.GetView().GetObject(),
3434
display.GetOverLayer())
3535
aTextureItem.SetAbsolutePosition(50, 50)
@@ -38,7 +38,7 @@ def absolute_position(event=None):
3838

3939
def relative_position(event=None):
4040
# create a texture
41-
aTextureItem = TextureItem(TCollection_AsciiString("./images/carre-200.png"),
41+
aTextureItem = TextureItem(TCollection_AsciiString("../assets/images/carre-200.png"),
4242
display.GetView().GetObject(),
4343
display.GetOverLayer())
4444
aTextureItem.SetRelativePosition(30, 60) # 30% width, 60% width
Collapse file

‎examples/core_display_point_cloud.py‎

Copy file name to clipboardExpand all lines: examples/core_display_point_cloud.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def random_points(event=None):
4848
display.FitAll()
4949

5050
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:]
5252
# create the point_cloud
5353
pc = Graphic3d_ArrayOfPoints(len(pcd_file))
5454
for line in pcd_file:
Collapse file

‎examples/core_display_textured_shape.py‎

Copy file name to clipboardExpand all lines: examples/core_display_textured_shape.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def GetProperties(self):
6363
#
6464
# First create texture and a material
6565
#
66-
texture_filename = './images/ground.bmp'
66+
texture_filename = '../assets/images/ground.bmp'
6767
t = Texture(texture_filename)
6868
m = Graphic3d_MaterialAspect(Graphic3d_NOM_SILVER)
6969
#
Collapse file

‎examples/core_export_stl.py‎

Copy file name to clipboardExpand all lines: examples/core_export_stl.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
my_torus = BRepPrimAPI_MakeTorus(20., 10.).Shape()
2525

2626
# 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"))
2928

3029
# make sure the path exists otherwise OCE get confused
3130
assert os.path.isdir(stl_output_dir)
Collapse file

‎examples/core_font_register.py‎

Copy file name to clipboardExpand all lines: examples/core_font_register.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
display, start_display, add_menu, add_function_to_menu = init_display()
2525

2626
# register the Respective font
27-
register_font(os.path.join('.', 'fonts', 'Respective.ttf'))
27+
register_font(os.path.join('..', 'assets', 'fonts', 'Respective.ttf'))
2828

2929
# text
3030
# Poetry from Paul Verlaine, Chanson d'Automne
Collapse file

‎examples/core_geometry_face_recognition_from_stepfile.py‎

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 numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def exit(event=None):
128128
display.SetSelectionModeFace() # switch to Face selection mode
129129
display.register_select_callback(recognize_clicked)
130130
# 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'))
132132
display.DisplayShape(shp, update=True)
133133
add_menu('recognition')
134134
add_function_to_menu('recognition', recognize_batch)
Collapse file

‎examples/core_geometry_geomplate.py‎

Copy file name to clipboardExpand all lines: examples/core_geometry_geomplate.py
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,8 @@ def build_curve_network(event=None):
278278
mimic the curve network surfacing command from rhino
279279
'''
280280
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)
286283

287284
print('Building geomplate...')
288285
topo = TopologyExplorer(iges)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.