Wildmeshing Toolkit
Loading...
Searching...
No Matches
Functions | Variables
view_offset Namespace Reference

Functions

 _decode (el)
 
 read_vtu (path)
 
 boundary_edges (tris, inside)
 
 to3d (pts2)
 
 compact (nodes, edges)
 
 add_run (label, vtu, color, seen_inputs)
 
 main (argv)
 

Variables

dict VTK_DTYPE
 
list PALETTE
 

Detailed Description

Polyscope viewer for topological_offset results.

Every layer is registered separately so it can be toggled in the UI: the input complex, and
per target distance the offset boundary and the offset region itself.

    pip install polyscope numpy
    python3 view_offset.py <outdir> [<outdir> ...]

Each <outdir> is a run_configs.py output directory -- it is scanned for */out.vtu. Pass the
construction and the optimized directory together to compare them in one window:

    python3 view_offset.py plot_con plot_opt

Layers are named "<dir>/<run> offset" and "<dir>/<run> band", plus one "input <tag>" per input
tag. Every layer starts hidden, so the window opens empty and you switch on exactly what you want
to compare. Everything is drawn in the z=0 plane and viewed
orthographically along z, with planar navigation.

Function Documentation

◆ _decode()

view_offset._decode (   el)
protected
VTK inline 'binary' is base64 of [UInt64 nbytes][payload], uncompressed.

◆ add_run()

view_offset.add_run (   label,
  vtu,
  color,
  seen_inputs 
)
Register the offset band, its boundary, and every input tag present as its own layer.

Which cell array means what is dataset-dependent -- the annots model calls the input
complex tag_1 and the offset tag_5, the disk example is the other way round -- so nothing
is hardcoded: `offset_tag` is written by the offset itself and names the band, and every
other tag_* array is registered as an input layer under its own name.

◆ boundary_edges()

view_offset.boundary_edges (   tris,
  inside 
)
Edges incident to exactly one `inside` triangle -- the boundary of that region.

◆ compact()

view_offset.compact (   nodes,
  edges 
)
Keep only the nodes the edges actually use, and reindex.

Polyscope draws a sphere at EVERY node of a curve network, so handing it the whole mesh
vertex array renders thousands of stray dots for vertices no edge touches.

◆ read_vtu()

view_offset.read_vtu (   path)
-> (points Nx2, triangles Mx3, {cell array name: values})

Variable Documentation

◆ PALETTE

list view_offset.PALETTE
Initial value:
1= [
2 (0.12, 0.44, 0.71),
3 (0.18, 0.62, 0.49),
4 (0.79, 0.54, 0.11),
5 (0.71, 0.28, 0.24),
6 (0.49, 0.35, 0.66),
7 (0.35, 0.35, 0.35),
8]

◆ VTK_DTYPE

dict view_offset.VTK_DTYPE
Initial value:
1= {
2 "Float64": np.float64,
3 "Float32": np.float32,
4 "Int64": np.int64,
5 "UInt64": np.uint64,
6 "Int32": np.int32,
7 "UInt8": np.uint8,
8}