Skip to content
Snippets Groups Projects
Commit 575da2aa authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

use relative paths w.r.t. script file directory using @__DIR__

parent d86ec45a
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ gmsh.model.add("t20") ...@@ -17,7 +17,7 @@ gmsh.model.add("t20")
# Load a STEP file (using `importShapes' instead of `merge' allows to directly # Load a STEP file (using `importShapes' instead of `merge' allows to directly
# retrieve the tags of the highest dimensional imported entities): # retrieve the tags of the highest dimensional imported entities):
path = abspath(joinpath("..","t20_data.step")) path = abspath(joinpath(@__DIR__, "..", "t20_data.step"))
v = gmsh.model.occ.importShapes(path) v = gmsh.model.occ.importShapes(path)
# If we had specified # If we had specified
...@@ -91,13 +91,12 @@ if surf ...@@ -91,13 +91,12 @@ if surf
# won't modify any OpenCASCADE entities later on): # won't modify any OpenCASCADE entities later on):
dels = gmsh.model.getEntities(2) dels = gmsh.model.getEntities(2)
for e in s for e in s
deleteat!(dels, findall(x->x==e,dels)) deleteat!(dels, findall(x -> x == e, dels))
end end
gmsh.model.removeEntities(gmsh.model.getEntities(3)) gmsh.model.removeEntities(gmsh.model.getEntities(3))
gmsh.model.removeEntities(dels) gmsh.model.removeEntities(dels)
gmsh.model.removeEntities(gmsh.model.getEntities(1)) gmsh.model.removeEntities(gmsh.model.getEntities(1))
gmsh.model.removeEntities(gmsh.model.getEntities(0)) gmsh.model.removeEntities(gmsh.model.getEntities(0))
end end
# Finally, let's specify a global mesh size and mesh the partitioned model: # Finally, let's specify a global mesh size and mesh the partitioned model:
......
...@@ -120,22 +120,22 @@ gmsh.view.addListDataString(v, [0, 0.11, 0], ["Hole"], ...@@ -120,22 +120,22 @@ gmsh.view.addListDataString(v, [0, 0.11, 0], ["Hole"],
# a `@' symbol in the form `widthxheight' (if one of `width' or `height' is # a `@' symbol in the form `widthxheight' (if one of `width' or `height' is
# zero, natural scaling is used; if both are zero, original image dimensions in # zero, natural scaling is used; if both are zero, original image dimensions in
# pixels are used): # pixels are used):
gmsh.view.addListDataString(v, [0, 0.09, 0], ["file://../t4_image.png@0.01x0"], png = abspath(joinpath(@__DIR__, "..", "t4_image.png"))
gmsh.view.addListDataString(v, [0, 0.09, 0], ["file://" * png * "@0.01x0"],
["Align", "Center"]) ["Align", "Center"])
# The 3D orientation of the image can be specified by proving the direction # The 3D orientation of the image can be specified by proving the direction
# of the bottom and left edge of the image in model space: # of the bottom and left edge of the image in model space:
gmsh.view.addListDataString(v, [-0.01, 0.09, 0], gmsh.view.addListDataString(v, [-0.01, 0.09, 0],
["file://../t4_image.png@0.01x0,0,0,1,0,1,0"]) ["file://" * png * "@0.01x0,0,0,1,0,1,0"])
# The image can also be drawn in "billboard" mode, i.e. always parallel to # The image can also be drawn in "billboard" mode, i.e. always parallel to
# the camera, by using the `#' symbol: # the camera, by using the `#' symbol:
gmsh.view.addListDataString(v, [0, 0.12, 0], gmsh.view.addListDataString(v, [0, 0.12, 0], ["file://" * png * "@0.01x0#"],
["file://../t4_image.png@0.01x0#"],
["Align", "Center"]) ["Align", "Center"])
# The size of 2D annotations is given directly in pixels: # The size of 2D annotations is given directly in pixels:
gmsh.view.addListDataString(v, [150, -7], ["file://../t4_image.png@20x0"]) gmsh.view.addListDataString(v, [150, -7], ["file://" * png * "@20x0"])
# These annotations are handled by a list-based post-processing view. For # These annotations are handled by a list-based post-processing view. For
# large post-processing datasets, that contain actual field values defined on # large post-processing datasets, that contain actual field values defined on
......
...@@ -14,7 +14,7 @@ import gmsh ...@@ -14,7 +14,7 @@ import gmsh
gmsh.initialize() gmsh.initialize()
# Merge a list-based post-processing view containing the target mesh sizes: # Merge a list-based post-processing view containing the target mesh sizes:
path = abspath(joinpath("..","t7_bgmesh.pos")) path = abspath(joinpath(@__DIR__, "..","t7_bgmesh.pos"))
gmsh.merge(path) gmsh.merge(path)
# If the post-processing view was model-based instead of list-based (i.e. if it # If the post-processing view was model-based instead of list-based (i.e. if it
......
...@@ -20,7 +20,7 @@ import gmsh ...@@ -20,7 +20,7 @@ import gmsh
gmsh.initialize() gmsh.initialize()
# Let us for example include a three-dimensional scalar view: # Let us for example include a three-dimensional scalar view:
path = abspath(joinpath("..","view3.pos")) path = abspath(joinpath(@__DIR__, "..","view3.pos"))
gmsh.merge(path) gmsh.merge(path)
v = gmsh.view.getTags() v = gmsh.view.getTags()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment