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")
# Load a STEP file (using `importShapes' instead of `merge' allows to directly
# 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)
# If we had specified
......@@ -97,7 +97,6 @@ if surf
gmsh.model.removeEntities(dels)
gmsh.model.removeEntities(gmsh.model.getEntities(1))
gmsh.model.removeEntities(gmsh.model.getEntities(0))
end
# 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"],
# 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
# 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"])
# 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:
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 camera, by using the `#' symbol:
gmsh.view.addListDataString(v, [0, 0.12, 0],
["file://../t4_image.png@0.01x0#"],
gmsh.view.addListDataString(v, [0, 0.12, 0], ["file://" * png * "@0.01x0#"],
["Align", "Center"])
# 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
# large post-processing datasets, that contain actual field values defined on
......
......@@ -14,7 +14,7 @@ import gmsh
gmsh.initialize()
# 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)
# If the post-processing view was model-based instead of list-based (i.e. if it
......
......@@ -20,7 +20,7 @@ import gmsh
gmsh.initialize()
# Let us for example include a three-dimensional scalar view:
path = abspath(joinpath("..","view3.pos"))
path = abspath(joinpath(@__DIR__, "..","view3.pos"))
gmsh.merge(path)
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