Skip to content

v1.5.1

Compare
Choose a tag to compare
@nodtem66 nodtem66 released this 08 Mar 10:04
· 30 commits to master since this release
20c4d60

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