Skip to content

Releases: nodtem66/Scaffolder

v1.5.2

08 Aug 22:39
Compare
Choose a tag to compare

Changes in v1.5.2

  • add a new --no_intersect to use only the boundary box of input mesh to generate 3d mesh
  • DualMC now supports parallel process with TBB (OneAPI)
  • add a new marching_cubes in python API for generating a 3D mesh with an array implicit iso-value.
    This function will work well as the alternative marching cubes for SDF.

For anyone interested in Constructive Solid Geometry, SDF is a pure python library same as PyScaffolder. It has a rich of 2D/3D topology, but the marching_cubes from skimage resulted in a bad 3D mesh sometimes and that why a new marching_cubes used in Scaffolder is exposed to Python API as an alternative method.

Program options

Scaffolder - generate 3D scaffold from STL file based on implicit surface
Usage:
  Scaffolder [OPTION...] INPUT OUTPUT PARAMETERS

  -h, --help                    Print help
  -i, --input INPUT             Input file (STL/PLY/OFF/OBJ/VMI)
  -o, --output OUTPUT           Output filename with extension
                                stl,ply,obj,off,ctm
      --params PARAMETERS       Combined parameters list:
                                surface[,coff,isolevel,grid_size,k_slice,k_polygon]
  -q, --quiet                   Disable verbose output [default: false]
  -c, --coff DOUBLE             Angular frequency (pore size adjustment)
                                default:PI
  -t, --isolevel DOUBLE         isolevel (porosity adjustment) [default: 0]
  -n, --surface NAME            implicit surface: rectlinear, schwarzp,
                                schwarzd, gyroid, double-p, double-d,
                                double-gyroiod, lidinoid, schoen_iwp, neovius, bcc,
                                tubular_g_ab, tubular_g_c (default: bcc)
  -g, --grid_size INT (0..60000)
                                Grid size [default: 100]
  -s, --shell INT (0..60000)    Outer thickness (layers) [default:0]
      --grid_offset INT (0..60000)
                                [default:3]
  -m, --microstructure          Analysis microstructure with Slice contour
                                technique ( [default: false]
      --export_microstructure   Analysis microstructure and export the 2D
                                contours (for debugging) [default: false]
      --export_jpeg [X|Y|Z],INT
                                Export 2D JPEG (Default: Z,100)
      --k_slice INT (0..60000)  K_slice: the number of slicing layers in each
                                direction (used in microstructure analysis)
                                (default: 100)
      --k_polygon INT (>0)      K_polygon: the number of closest outer
                                contour (used in microstructure analysis) (default:
                                4)
  -z, --size_optimize DOUBLE (0..1)
                                Experimental Quadric simplification (default:
                                0)
      --smooth_step INT (0..60000)
                                Smooth with laplacian (default: 0)
      --dirty                   Disable autoclean
      --minimum_diameter DOUBLE (0..1)
                                used for removing small orphaned (between
                                0-1) (default: 0.25)
      --format FORMAT (default, csv)
                                Format of logging output (default: default)
      --output_inverse          additional output inverse scaffold
      --fix_self_intersect INT  Experimental fix self-intersect faces
                                (default: 0)
      --mean_curvature INT      Size of mean curvature histogram (default: 0)
      --no_intersect            Generate 3D mesh without intersect with
                                original mesh (false)

Example:

  Scaffolder input.stl output.stl bcc,3.14159,0,100
    Generated BCC scaffold with w=3.14159 (PI), t=0, and grid size=100

  Scaffolder input.stl output.stl custom.lua,3.14159,0,100,100,4 -m
    Generated and evaluated scaffold with custom.lua, w=3.14159 (PI), t=0,
    grid size=100, k_slice=100, k_polygon=4

  Scaffolder input.stl output.stl bcc,3.14159,0 -m -q --format csv
    Generated and evaluated BCC scaffold (w=3.14159, t=0) and reported in CSV


Lua file:

  Define the "surface" function that return the implicit function
  -----------------------------------------------------------------
  function surface (x, y, z)
    return sin(x) * cos(y) + sin(y) * cos(z) + sin(z) * cos(x) - params.isolevel
  end
  -----------------------------------------------------------------

Special symbols can be used in lua file:

  params = { coff, isolevel, k_splice, k_polygon }
  bbox = { min, max, length, grid_density }
  winding(x,y,z): function returning the winding number of position x,y,z
  signed_distance(x,y,z): function returning signed distance of position x,y,z
  and all functions from math module

See documentation

v1.5.1

08 Mar 10:04
20c4d60
Compare
Choose a tag to compare

Changes from v1.4

  • replace --m1 and --m2 with only -m option. The pore size evaluation now only uses the slicing contour technique (-m).

New features in v1.5

  • introduce the third argument (PARAMETERS) to shorten the common options into one.
$ Scaffolder cube20mm.stl out.ply -c 3.14159 -g 100 -n tubulat_g_ab
// new in v1.5
$ Scaffolder cube20mm.stl out.ctm tubulat_g_ab,3.14159,0,100
// or without generating output file
$ Scaffolder cube20mm.stl --params tubulat_g_ab,3.14159,0,100
  • introduce --format to change the stdout styles (default, csv).
// change stdout format to CSV
$ Scaffolder cube20mm.stl --params bcc,3.14159,0,100 --format csv
// When use with quiet option (-q), the stdout will show only progress bar
// and log file will be created
$ Scaffolder cube20mm.stl --params bcc,3.14159,0,100 --format csv -q
  • introduce LUA file to custom the implicit function
-- suppose that this is the content of my.lua
function surface (x, y, z)
  return x^2+y^2+z^2-1
end

Then you can fill the surface option with lua script (my.lua)

$ Scaffolder input.stl output.stl ./my.lua,3.14159,0,100 --format csv -q

Changes in v1.5.1

  • New special symbols in lua scripts
-- suppose that this is a content of my.lua used in command line:
-- $ Scaffolder cube1mm.stl output.stl ./my.lua,3.14159,0,150
-- The meta-table called `params` contains the program parameters, in this case:
-- params = { coff = 3.14159, isolevel = 0, k_splice = 100, k_polygon = 4 }
-- bbox = { min = [0,0,0], max = [1,1,1], length = [1,1,1], grid_density = 150 }
w = params.coff
t = params.isolevel
-- This function generate a surface from two different function combined by signed distance field (SDF) of cube1mm.stl
function surface (x, y, z)
	s = signed_distance(x,y,z)
	v = winding(x,y,z)
	a = 2*s/bbox.length[1]
	f1 = ffa(w*x*2, w*y*2, w*z*2)
	f2 = ffb(w*x, w*y, w*z)
	return (1-a)*f1 + (a)*f2
end

function ffa (x, y, z)
	return 20*(cos(x)*sin(y)+cos(y)*sin(z)+cos(z)*sin(x))-0.5*(cos(2*x)*cos(2*y)+cos(2*y)*cos(2*z)+cos(2*z)*cos(2*x))-4
end

function ffb (x, y, z)
	return 10*(cos(x)*sin(y)+cos(y)*sin(z)+cos(z)*sin(x))-2*(cos(2*x)*cos(2*y)+cos(2*y)*cos(2*z)+cos(2*z)*cos(2*x))-12
end
  • add --mean_curvature and --export_jpeg options
  • support OpenCTM format (.ctm) for 3D mesh exporting

Program options

Scaffolder - generate 3D scaffold from STL file based on implicit surface
Usage:
  Scaffolder [OPTION...] INPUT OUTPUT PARAMETERS

  -h, --help                    Print help
  -i, --input INPUT             Input file (STL/PLY/OFF/OBJ/VMI)
  -o, --output OUTPUT           Output filename with extension
                                stl,ply,obj,off
      --params PARAMETERS       Combined parameters list:
                                surface[,coff,isolevel,grid_size,k_slice,k_polygon]
  -q, --quiet                   Disable verbose output [default: false]
  -c, --coff DOUBLE             Angular frequency (pore size adjustment)
                                default:PI
  -t, --isolevel DOUBLE         isolevel (porosity adjustment) [default: 0]
  -n, --surface NAME            implicit surface: rectlinear, schwarzp,
                                schwarzd, gyroid, double-p, double-d,
                                double-gyroiod, lidinoid, schoen_iwp, neovius, bcc,
                                tubular_g_ab, tubular_g_c [default: schwarzp]
  -g, --grid_size INT (0..60000)
                                Grid size [default: 100]
  -s, --shell INT (0..60000)    Outer thickness (layers) [default:0]
      --grid_offset INT (0..60000)
                                [default:3]
  -m, --microstructure          Analysis microstructure with Slice contour
                                technique ( [default: false]
      --export_microstructure   Analysis microstructure and export the 2D
                                contours (for debugging) [default: false]
      --export_jpeg [X|Y|Z],INT
                                Export 2D JPEG [Default: Z,100]
      --k_slice INT (0..60000)  K_slice: the number of slicing layers in each
                                direction (used in microstructure analysis)
                                [default: 100]
      --k_polygon INT (>0)      K_polygon: the number of closest outer
                                contour (used in microstructure analysis) [default:
                                4]
  -z, --size_optimize DOUBLE (0..1)
                                Experimental Quadric simplification [default:
                                0]
      --smooth_step INT (0..60000)
                                Smooth with laplacian (default: 5)
      --dirty                   Disable autoclean [default false]
      --minimum_diameter DOUBLE (0..1)
                                used for removing small orphaned (between
                                0-1) [default: 0.25]
      --format FORMAT (default, csv)
                                Format of logging output [default: default]
      --output_inverse          additional output inverse scaffold [default:
                                false]
      --fix_self_intersect      Experimental fix self-intersect faces
                                [default: false]
      --mean_curvature          Experimental calculate mean curvature

Example:

  Scaffolder input.stl output.stl bcc,3.14159,0,100
    Generated BCC scaffold with w=3.14159 (PI), t=0, and grid size=100

  Scaffolder input.stl output.stl custom.lua,3.14159,0,100,100,4 -m
    Generated and evaluated scaffold with custom.lua, w=3.14159 (PI), t=0,
    grid size=100, k_slice=100, k_polygon=4

  Scaffolder input.stl output.stl bcc,3.14159,0 -m -q --format csv
    Generated and evaluated BCC scaffold (w=3.14159, t=0) and reported in CSV


Lua file:

  Define the "surface" function that return the implicit function
  -----------------------------------------------------------------
  function surface (x, y, z)
    return sin(x) * cos(y) + sin(y) * cos(z) + sin(z) * cos(x) - params.isolevel
  end
  -----------------------------------------------------------------

Special symbols can be used in lua file:

  params = { coff, isolevel, k_splice, k_polygon }
  bbox = { min, max, length, grid_density }
  winding(x,y,z): function returning the winding number of position x,y,z
  signed_distance(x,y,z): function returning signed distance of position x,y,z
  and all functions from math module

Tips

Angular frequency (w)
w = 2PI * N / L
where PI = 3.14159, N = the number of unit cells, and L = the length of input 3D mesh
For example, if we want N=2 in cube20mm.stl (L=20), w will be 2PI*2/20 = PI/5
Please remind that the unit the same dimension with the input mesh
Example:
$ ./Scaffolder cube20mm.stl out.ply -c 3.14159 -g 100 -n tubulat_g_ab
Program will generate the scaffold from cube20mm.stl (L=20) with theoretical N=10

v1.5.0-alpha

01 Feb 04:43
042129a
Compare
Choose a tag to compare

Changes from v1.4

  • replace --m1 and --m2 with only -m option. The pore size evaluation now only uses the slicing contour technique (-m).

New features in v1.5

  • introduce the third arguments (PARAMETERS) to shorten the common options into one.
$ Scaffolder cube20mm.stl out.ply -c 3.14159 -g 100 -n tubulat_g_ab
// new in v1.5
$ Scaffolder cube20mm.stl tubulat_g_ab,3.14159,0,100
// or without generating output file
$ Scaffolder cube20mm.stl --params tubulat_g_ab,3.14159,0,100
  • introduce --format to change the stdout styles (default, csv).
// change stdout format to CSV
$ Scaffolder cube20mm.stl --params bcc,3.14159,0,100 --format csv
// When use with quiet option (-q), the stdout will show only progress bar
// and log file will be created
$ Scaffolder cube20mm.stl --params bcc,3.14159,0,100 --format csv -q
  • introduce LUA file to custom the implicit function
-- suppose that this is the content of my.lua
function surface (x, y, z)
  return sin(w*x) * cos(w*y) + sin(w*y) * cos(w*z) + sin(w*z) * cos(w*x) - t
end

Then you can fill the surface option with lua script (my.lua)

$ Scaffolder input.stl output.stl ./my.lua,3.14159,0,100 --format csv -q

Program options

Scaffolder - generate 3D scaffold from STL file
Usage:
  Scaffolder [OPTION...] INPUT OUTPUT PARAMETERS

  -h, --help                    Print help
  -i, --input INPUT             Input file (STL)
  -o, --output OUTPUT           Output filename with extension
                                stl,ply,obj,off [default: out]
      --params PARAMETERS       Combined parameters list:
                                surface[,coff,isolevel,grid_size,k_slice,k_polygon]
  -q, --quiet                   Disable verbose output [default: false]
  -c, --coff DOUBLE             Angular frequency (pore size adjustment)
                                default:PI
  -t, --isolevel DOUBLE         isolevel (porosity adjustment) [default: 0]
  -n, --surface NAME            implicit surface: rectlinear, schwarzp,
                                schwarzd, gyroid, double-p, double-d,
                                double-gyroiod, lidinoid, schoen_iwp, neovius, bcc,
                                tubular_g_ab, tubular_g_c [default: schwarzp]
  -g, --grid_size INT (0..60000)
                                Grid size [default: 100]
  -s, --shell INT (0..60000)    Outer thickness (layers) [default:0]
      --grid_offset INT (0..60000)
                                [default:3]
  -m, --microstructure          Analysis microstructure with Slice contour
                                technique ( [default: false]
      --export_microstructure   Analysis microstructure and export the 2D
                                contours (for debugging) [default: false]
      --k_slice INT (0..60000)  K_slice: the number of slicing layers in each
                                direction (used in microstructure analysis)
                                [default: 100]
      --k_polygon INT (>0)      K_polygon: the number of closest outer
                                contour (used in microstructure analysis) [default: 4]
  -z, --size_optimize DOUBLE (0..1)
                                Experimental Quadric simplification [default: 0]
      --smooth_step INT (0..60000)
                                Smooth with laplacian (default: 5)
      --dirty                   Disable autoclean [default false]
      --minimum_diameter DOUBLE (0..1)
                                used for removing small orphaned (between 0-1) [default: 0.25]
      --format FORMAT (default, csv)
                                Format of logging output [default: default]
      --output_inverse          additional output inverse scaffold [default: false]
      --fix_self_intersect      Experimental fix self-intersect faces
                                [default: false]

Example:

  Scaffolder input.stl output.stl bcc,3.14159,0,100
    Generated BCC scaffold with w=3.14159 (PI), t=0, and grid size=100

  Scaffolder input.stl output.stl custom.lua,3.14159,0,100,100,4 -m
    Generated and evaluated scaffold with custom.lua, w=3.14159 (PI), t=0,
    grid size=100, k_slice=100, k_polygon=4

  Scaffolder input.stl output.stl bcc,3.14159,0 -m -q --format csv
    Generated and evaluated BCC scaffold (w=3.14159, t=0) and reported in CSV


Lua file:

  Define the "surface" function that return the implicit function
  -----------------------------------------------------------------
  function surface (x, y, z)
    return sin(x) * cos(y) + sin(y) * cos(z) + sin(z) * cos(x) - t
  end
  -----------------------------------------------------------------

Special symbols can be used in lua file:

  w: value from -c, or --coff
  t: value from -t, or --thickness
  winding(x,y,z): function returning the winding number of position x,y,z
  signed_distance(x,y,z): function returning signed distance of position x,y,z
  and all functions from math module

Tips

Coefficient usage
coff = PI/target_pore_size
Please remind that use the same dimension with the input mesh
Example:
$ ./Scaffolder cube20mm.stl out.ply -c 3.14159 -g 100 -n tubulat_g_ab
Program will generate the scaffold from cube20mm.stl with theoretical pore size 1mm of tubular_g_ab

v1.4 Release

27 Aug 02:58
4c109e6
Compare
Choose a tag to compare
Scaffolder - generate 3D scaffold from STL file
Usage:
  Scaffolder [OPTION...] INPUT OUTPUT FORMAT

  -h, --help                    Print help
  -q, --quiet                   Disable verbose output [default: false]
  -i, --input FILE              Input file (STL)
  -o, --output FILENAME         Output filename without extension [default:
                                out]
  -f, --format arg              Output format (OFF,PLY,STL,OBJ) [default:
                                ply]
  -c, --coff DOUBLE             default:4*PI
  -s, --shell INT               [default:0]
  -n, --surface NAME            rectlinear, schwarzp, schwarzd, gyroid,
                                double-p, double-d, double-gyroiod, lidinoid,
                                schoen_iwp, neovius, bcc, tubular_g_ab, tubular_g_c
                                [default: schwarzp]
  -t, --thickness DOUBLE        Thickness [default: 0]
  -g, --grid_size INT           Grid size [default: 100]
      --grid_offset INT         [default:3]
      --smooth_step INT         Smooth with laplacian (default: 5)
  -m, --microstructure          Analysis microstructure ( [default: false]
      --m1                      Export and analysis microstructure 1 (Image
                                processing technique) [default: false]
      --m2                      Export and analysis microstructure 2 (Slice
                                coutour technique) [default: false]
      --method 0,1              Method of microstructure analysis: 0 (Image
                                processing technique) or 1 (Slice contour
                                technique) [default: 1]
      --slice_grid INT          Slice Grid used in microstructure analysis
                                [default: 100]
      --output_inverse          additional output inverse scaffold [default:
                                false]
      --inverse                 Enable build inverse 3D scaffold (for pore
                                connectivity analysis) [default: false]
      --dirty                   Disable autoclean [default false]
      --fix_self_intersect      Experimental fix self-intersect faces
                                [default: false]
      --qsim DOUBLE (0..1)      Experimental Quadric simplification [default:
                                0]
      --minimum_diameter DOUBLE
                                used for removing small orphaned (between
                                0-1) [default: 0.25]

Coefficient usage
coff = PI/target_pore_size
Please remind that use the same dimension with the input mesh
Example:
$ ./scaffolder cube20mm.stl out.ply -c 3.14159 -g 100 -n tubulat_g_ab
Program will generate the scaffold from cube20mm.stl with theoretical pore size 1mm of tubular_g_ab

v1.3 Release

14 Mar 00:19
31610ab
Compare
Choose a tag to compare
Scaffolder - generate 3D scaffold from STL file
Usage:
  Scaffolder [OPTION...] INPUT OUTPUT FORMAT

  -h, --help                    Print help
  -q, --quiet                   Disable verbose output [default: false]
  -i, --input FILE              Input file (STL)
  -o, --output FILENAME         Output filename without extension [default:
                                out]
  -f, --format arg              Output format (OFF,PLY,STL,OBJ) [default:
                                ply]
  -c, --coff DOUBLE             default:4*PI
  -s, --shell INT               [default:0]
  -n, --surface NAME            rectlinear, schwarzp, schwarzd, gyroid,
                                double-p, double-d, double-gyroiod, lidinoid,
                                schoen_iwp, neovius, bcc, tubular_g_ab, tubular_g_c
                                [default: schwarzp]
  -t, --thickness DOUBLE        Thickness [default: 0]
  -g, --grid_size INT           Grid size [default: 100]
      --grid_offset INT         [default:3]
      --smooth_step INT         Smooth with laplacian (default: 5)
  -m, --microstructure          Analysis microstructure ( [default: false]
      --m1                      Export and analysis microstructure 1 (Image
                                processing technique) [default: false]
      --m2                      Export and analysis microstructure 2 (Slice
                                coutour technique) [default: false]
      --method 0,1              Method of microstructure analysis: 0 (Image
                                processing technique) or 1 (Slice contour
                                technique) [default: 1]
      --slice_grid INT          Slice Grid used in microstructure analysis
                                [default: 100]
      --output_inverse          additional output inverse scaffold [default:
                                false]
      --inverse                 Enable build inverse 3D scaffold (for pore
                                connectivity analysis) [default: false]
      --dirty                   Disable autoclean [default false]
      --fix_self_intersect      Experimental fix self-intersect faces
                                [default: false]
      --qsim DOUBLE (0..1)      Experimental Quadric simplification [default:
                                0]
      --minimum_diameter DOUBLE
                                used for removing small orphaned (between
                                0-1) [default: 0.25]

Coefficient usage
coff = PI/target_pore_size
Please remind that use the same dimension with the input mesh
Example:
$ ./scaffolder cube20mm.stl out.ply -c 3.14159 -g 100 -n tubulat_g_ab
Program will generate the scaffold from cube20mm.stl with theoretical pore size 1mm of tubular_g_ab

v1.1-alpha (x64-Windows)

27 Dec 18:14
6a212d6
Compare
Choose a tag to compare
Usage:
  Scaffolder [OPTION...] [option args]

  -h, --help                    Print help
  -q, --quiet                   Disable verbose output
  -f, --format arg              Output format (OFF,PLY,STL,OBJ) [default:
                                ply]
  -i, --input FILE              Input file (STL)
  -o, --output FILENAME         Output filename without extension [default:
                                out]
  -c, --coff DOUBLE             default:4*PI
  -s, --shell INT               [default:0]
  -n, --surface NAME            schwarzp, schwarzd, gyroid, lidinoid,
                                schoen_iwp, neovius, pwhybrid [default: schwarzp]
  -t, --thickness DOUBLE        Thickness [default: 1.0]
  -g, --grid_size INT           Grid size [default: 100]
      --grid_offset INT         [default:2]
      --dirty                   Disable autoclean
      --minimum_diameter DOUBLE
                                used for removing small orphaned (between
                                0-1) [default: 0.25]

Requirement: vcruntime140

v1.0-alpha (x64-windows)

14 Dec 03:52
9c43d83
Compare
Choose a tag to compare
Usage: Scaffolder_2 [options]
Options:
    -q, --quiet            Disable verbose output
    -f, --format           Output format (OFF,PLY,STL,OBJ) [default: ply]
    -i, --input            Input file (STL) (Required)
    -o, --output           Output filename without extension [default: out]
    -g, --grid             Grid size [default: 100]
    --thickness            Thickness [default: 1.0]
    --border_offset        default:2
    --coff                 default:4*PI
    --minimum_diameter     used for removing small orphaned (between 0-1) [default: 0.25]
    --surface               schwarzp, schwarzd, gyroid, lidinoid, scherk [default: schwarzp]

Requirement vcruntime140