Spike boolean-weld: weld pass, measures, renders and result note
The operator's weld rule automated on the Dexter Quiet hull with boolmesh (identical output to Manifold). Owner by curvature across the loop (as planned) fails the gun port; along the loop it passes it (slivers 32 to 5, worst angle 0.007 to 5.1 deg, silhouette unchanged). Planar panel splits get nothing from the rule. Note: docs/research/spike-boolean-weld.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
219
docs/research/spike-boolean-weld.md
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
# Spike: boolean cut and split on the Dexter Quiet hull, welded by the operator's rule
|
||||
|
||||
Campaign brush-tree, target r3 (invariants weld-rule, detail-is-boolean, two-layers, shippable-stack). Serves rulings
|
||||
`boolean-cleanup-tighter-curve-wins` and `panel-lines-by-split-boolean-r2`. Plan: Imagination's `spike-boolean-weld.md`.
|
||||
Agent `spike-bt-boolean-weld`, 2026-10-12. A spike, not a cut: the code under `spikes/boolean-weld/` is scratch.
|
||||
|
||||
Her words, the spec of the rule: "the surface with the tighter curve defines the silhouette of the cut, and the spare
|
||||
vertices that come from the flatter surface all get merged away."
|
||||
|
||||
## Answer
|
||||
|
||||
- **As the plan wrote it (owner by curvature across the loop, `u = n x t`), the rule fails on the gun port.** A
|
||||
cylinder has zero curvature across its own cut loop (that direction is its axis), so the hull owns 34 of 36 loop
|
||||
vertices and the weld merges away the cylinder's circle samples. The port's silhouette error doubles (max 0.0198 %
|
||||
to 0.045 % of the diagonal) and the worst angle does not improve (0.007 deg).
|
||||
- **Measured along the loop (`k = II(t, t)` on each surface), the rule works for the gun port.** The cylinder owns
|
||||
every loop vertex, the 10 hull-made loop vertices merge onto it, and none is refused. Slivers in the band drop from 32 to 5. The minimum
|
||||
angle goes from 0.007 to 5.1 deg and the 5th percentile from 1.1 to 6.7 deg. The silhouette is unchanged, nothing
|
||||
flips and no vertex moves outside the band. Edges shorter than the bevel width touching the loop drop from 6 to 0,
|
||||
so the shipped Bevel's clamp no longer chokes the seam: the render shows a continuous bevel highlight where the
|
||||
naive cut has almost none. This reading, the curvature that bends the cut curve, matches her sentence ("defines
|
||||
the silhouette of the cut"). That is inference, and a question for Self below.
|
||||
- **For the panel split the rule is a no-op.** A planar cutter contributes no loop vertices, since every one of the
|
||||
124 loop vertices is a hull edge crossing the plane. The hull owns all of them in every direction mode, and nothing
|
||||
merges. The 97 slivers in the band (37 hull-side, 60 in the cap; worst angle 0.058 deg) are the owner's own, and
|
||||
her rule does not speak to them.
|
||||
- **Kernel: boolmesh 0.2.1.** It gives the same output as Manifold to the bit (identical vertex sets and triangle
|
||||
counts on every case), builds as pure Rust in 14 s on Windows, and carries provenance as a per-corner value.
|
||||
Manifold (manifold-csg 0.4.1 over Manifold v3.5.3) builds in 89 s on Linux and fetches upstream C++ source at
|
||||
build time.
|
||||
|
||||
## Inputs
|
||||
|
||||
- Hull: `Dexter Quiet Cage` re-exported from a copy of Ships.blend with Bevel and Weighted Normal off (Mirror, then
|
||||
Subsurf level 3 with limit surface): 3,010 vertices, 6,016 triangles, 0 non-manifold edges, 0 misoriented, Euler 2
|
||||
(watertight, genus 0), diagonal 1.4584, mean edge 0.0256 (p5 0.0067, p95 0.048). The 144 evaluated crease edges
|
||||
equal the cage's bevel-weight edges (midpoint match 8e-8). Fixtures: `spikes/boolean-weld/fixtures/`.
|
||||
`cage_eval.obj` (3,154 vertices, Bevel baked in) was not used.
|
||||
- Curvature: a per-vertex quadric fit over the 2-ring of the evaluated mesh, giving a 3x3 second fundamental form;
|
||||
sign positive for convex. This is not the limit-surface `X = S c` (S not extracted). Hull crease edges count as
|
||||
infinite curvature, so the hull always owns there. Cutter curvature is analytic: cylinder `e_theta e_theta^T / r`,
|
||||
box faces 0.
|
||||
- Cutters (`cases.py`). Gun port: cylinder r 0.015 on the upper flank at (0.17, 0.0), axis on the face normal,
|
||||
sunk 0.02, 16 and 48 segments. Split: box over y > 0.22, a transverse break round the forward body; both pieces
|
||||
kept. Probes:
|
||||
- equal-k: cylinder r 0.0199 = 1/|k|max at hull vertex 1799.
|
||||
- saddle: cylinder r 0.015 at vertex 538, k1 = -7.0, k2 = 55.2. The hull is 0.0143 thick there, so the port is sunk
|
||||
0.0086, not 0.02.
|
||||
- crease: box x > 0.33, a chordwise split across the wing-rim crease.
|
||||
- switch: cylinder r 0.08 across the dorsal ridge.
|
||||
- True-curve reference: the same cylinder at 1,024 segments. For planes the boolean loop is exact.
|
||||
|
||||
## Weld pass (`py/weld.py`)
|
||||
|
||||
1. Loop = edges between a hull-provenance face and a cutter-provenance face, traced into cycles. Neither kernel
|
||||
returns the loop or each loop vertex's source edge, so origin is a geometric test: whether the vertex lies on an
|
||||
original hull edge (H), a cutter edge (C) or both (1.5e-6 tolerance).
|
||||
2. Owner per loop vertex = larger |k|, ties to the hull. The direction modes are `across` (the plan), `along` and
|
||||
`mean`.
|
||||
3. Collapses: a loop vertex of yielding-side origin merges into the nearest owner-origin loop vertex along the loop.
|
||||
The `literal` scope also merges the yielding surface's one-ring onto the loop; `looponly` does not.
|
||||
4. Guard: refuse a collapse on a face flip (old·new normal <= 0), on a worst angle below 10 deg when it got worse,
|
||||
on a missing edge, or on a failed link condition. Refusals are counted, never forced.
|
||||
5. Split: collapses from the subtract piece are replayed by position on the intersect piece.
|
||||
6. Candidate change tested (`-snap`), not her rule: the owner's own vertices within 0.25 local edge lengths of a loop
|
||||
vertex, and loop edges shorter than the 0.001 bevel width, also collapse, with the same guard.
|
||||
|
||||
## Measures (boolmesh; Manifold's numbers are identical)
|
||||
|
||||
Band = triangles whose centroid is within 2 local edge lengths of the loop. Sliver = longest edge squared over twice
|
||||
the area > 10, or area < 1e-4 of the mean. Dev = welded loop polyline to the true intersection curve, in % of the
|
||||
diagonal and in local edge lengths h. Out = hull vertices moved outside the band.
|
||||
|
||||
| case | variant | collapses | band tris | slivers | min deg | p5 deg | flips | dev max % | dev max /h | out |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| port s16 | naive | | 157 | 32 | 0.007 | 1.14 | 0 | 0.0198 | 0.0096 | 0 |
|
||||
| port s16 | across (plan) | 12 | 133 | 12 | 0.007 | 2.83 | 0 | 0.045 | 0.022 | 0 |
|
||||
| port s16 | **along** | 10 | 137 | **5** | **5.09** | **6.68** | 0 | 0.0198 | 0.0096 | 0 |
|
||||
| port s48 | naive | | 339 | 227 | 0.016 | 0.92 | 0 | 0.0023 | 0.0011 | 0 |
|
||||
| port s48 | across | 19 | 301 | 173 | 0.016 | 1.47 | 0 | 0.0064 | 0.0031 | 0 |
|
||||
| port s48 | along | 8 | 323 | 211 | 0.47 | 1.57 | 0 | 0.0023 | 0.0011 | 0 |
|
||||
| port s48 | along-snap | 40 | 259 | 119 | 0.93 | 2.25 | 0 | 0.0055 | 0.0027 | 0 |
|
||||
| split sub | naive = every rule variant | 0 | 507 | 97 | 0.058 | 1.46 | 0 | 0 | 0 | 0 |
|
||||
| split sub | along-snap | 7 | 496 | 85 | 0.058 | 2.07 | 0 | 0.0087 | 0.0051 | 0 |
|
||||
| equal-k s16 | naive | | 457 | 87 | 1.5e-6 | 1.65 | 0 | 0.056 | 0.072 | 0 |
|
||||
| equal-k s16 | along | 38 | 359 | 38 | 1.7e-6 | 3.67 | 0 | 0.055 | 0.073 | 0 |
|
||||
| equal-k s48 | along | 53 | 506 | 73 | 0.157 | 2.98 | 0 | 0.0064 | 0.0082 | 0 |
|
||||
| saddle s16 | naive | | 209 | 50 | 2.8e-6 | 0.61 | 0 | 0.094 | 0.067 | 0 |
|
||||
| saddle s16 | along | 21 | 167 | 25 | 0.003 | 0.94 | **1** | 0.094 | 0.067 | 0 |
|
||||
| saddle s48 | along | 28 | 309 | 83 | 0.003 | 0.85 | 0 | 0.012 | 0.0088 | 0 |
|
||||
| crease sub | naive = every rule variant | 0 | 342 | 44 | 0.033 | 2.41 | 0 | 0 | 0 | 0 |
|
||||
| switch s48 | naive | | 488 | 112 | 1.2e-6 | 0.62 | 0 | 0.0128 | 0.0062 | 0 |
|
||||
| switch s48 | along | 48 | 392 | 57 | 1.2e-6 | 2.12 | 0 | 0.0196 | 0.0095 | 0 |
|
||||
|
||||
The full table (every variant, both kernels' rows, refusal counts) is in `spikes/boolean-weld/results/`.
|
||||
|
||||
Ownership per mode, as owner counts (hull / cutter) and owner switches per loop:
|
||||
|
||||
| case | across | along | mean |
|
||||
|---|---|---|---|
|
||||
| port s16 | 34 / 2, 4 switches | 0 / 36, 0 | 0 / 36, 0 |
|
||||
| split | 124 / 0, 0 | 124 / 0, 0 | 124 / 0, 0 |
|
||||
| equal-k s16 | 50 / 41, 10 | 21 / 70, 8 (11 within 10 % of a tie) | 16 / 75, 2 |
|
||||
| equal-k s48 | 82 / 54, 10 | 24 / 112, 6 (15 near-tie) | 21 / 115, 2 |
|
||||
| saddle s16 | 36 / 21, 18 | 9 / 48, 14 | 13 / 44, 10 |
|
||||
| switch s48 | 79 / 53, 12 | 24 / 108, 4 | 22 / 110, 4 |
|
||||
|
||||
Shortest edge touching the loop, which bounds the bevel through Bevel's overlap clamp; the count is edges under the
|
||||
0.001 bevel width:
|
||||
|
||||
| case | naive | across | along |
|
||||
|---|---|---|---|
|
||||
| port s16 | 5.3e-5 (6) | 5.3e-4 (4) | 2.3e-3 (0) |
|
||||
| port s48 | 5.6e-5 (52) | 5.6e-5 (32) | 2.2e-4 (40) |
|
||||
| saddle s16 | 1.4e-6 (19) | 1.4e-6 (3) | 1.4e-6 (9) |
|
||||
| split | 2.6e-4 (15) | unchanged | unchanged |
|
||||
|
||||
## Per case
|
||||
|
||||
1. **Gun port, 16 segments.** With `along` the rule passes, apart from a 5.1 deg worst angle against a 10 deg guard.
|
||||
With `across` it fails (see Answer).
|
||||
2. **Gun port, 48 segments (probe 5).** The rule keeps the cutter's dense samples, which is the right silhouette, but
|
||||
leaves 86 hull-side fans: hull vertices about 0.025 away fanned to cutter samples 0.002 apart. Another 125
|
||||
"slivers" are the cylinder's own wall quads, 0.05 tall by 0.002 wide, which are inherent to the cutter's
|
||||
tessellation and not caused by the boolean. The 16-segment cutter (spacing 0.0059, about 0.23 h) welds clean; at
|
||||
48 (about 0.08 h) only the snap variant helps much. The rule needs the cutter's spacing no finer than about a
|
||||
quarter of the hull's local edge length; finer than that, fans remain that no merge can remove.
|
||||
3. **Panel split.** No-op, as above. The two pieces' loops coincide vertex for vertex (gap 0). Caps: with both caps
|
||||
kept, the bevelled seam reads as a panel line. With both caps dropped, nothing shows, because Bevel on an open
|
||||
boundary edge makes no seam. So the caps must stay for her panel-line method. The capped render shows a light
|
||||
streak partway along the seam, at the cap's sliver triangles (cutter side, worst 0.058 deg). Replaying the snap
|
||||
variant's collapses onto the second piece split the loops apart: the second piece refused 2 and could not match 1
|
||||
by position, opening a 6.8e-4 gap, a crack in the panel. A split's collapses must be accepted by both pieces'
|
||||
guards or by neither.
|
||||
4. **Equal curvature (probe 1).** Ownership flickers: 6 to 10 owner switches per loop, and 11 to 15 loop vertices
|
||||
within 10 % of a tie in `along` mode. It produced no flips and no silhouette step (along dev 0.055 % against
|
||||
naive 0.056 %). When the two |k| are close, either owner gives about the same curve. The 1.5e-6 deg needle
|
||||
survives every variant: it belongs to the owner, and the rule never touches it.
|
||||
5. **Saddle (probe 2).** The owner depends on the direction: across 36 / 21, along 9 / 48, mean 13 / 44, with 10 to 18
|
||||
switches. The hull's normal curvature there ranges from -7.0 to 55.2 with direction. Mean curvature gives fewer
|
||||
switches than along, but it answers a different question: how curved the surface is, not how much it bends the
|
||||
cut. After every weld variant one hull triangle in the band counts as "flipped" (normal · hull normal = -0.013,
|
||||
0.76 h from the rim crease): a near-vertical sliver whose normal is noise. It fails the zero-flip measure, and
|
||||
the cut here also reaches the crease (2 crease loop vertices).
|
||||
6. **Cut across a crease (probe 3).** Passes, trivially. The 2 crease loop vertices are hull-owned (infinite k), no
|
||||
collapse happens near them, both crease vertices survive, and every crease edge keeps its bevel weight on both
|
||||
pieces (144 weighted edges become 126 + 20: the 2 crossed crease edges each split into weighted halves). Nothing
|
||||
merges across the crease. The plane contributes nothing to merge, so this probe does not stress the rule. A
|
||||
curved cutter across a crease would; it was not run.
|
||||
7. **Ownership switch (probe 4).** Along the r 0.08 loop the owner switches 4 times. At the switch vertices: no
|
||||
flips, slivers 112 to 57, and a silhouette that moves from 0.0128 to 0.0196 % max (0.0095 h). The steps are
|
||||
below a tenth of a local edge. The worst angle stays 1.2e-6 deg, another owner-side needle. The render shows
|
||||
radial shading streaks round this cut in every variant, naive and welded: Weighted Normal over long hull-side
|
||||
fan triangles.
|
||||
|
||||
Locality held everywhere (invariant two-layers): 0 hull vertices moved outside the band in every case and variant.
|
||||
|
||||
## Renders
|
||||
|
||||
Each sheet shows the naive result, the ownership along the loop (blue = hull owns, orange = cutter owns) under
|
||||
`across` and under `along`, and the welded results. Every result is shown after the shipped stack: Bevel 0.001,
|
||||
1 segment, weight-limited, plus Weighted Normal, with settings copied from the cage's own modifiers, rendered
|
||||
headless with Workbench. Loop edges carry bevel weight 1 and hull crease edges keep theirs.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
The split sheet shows four panels: both pieces with caps, both pieces without caps, the subtract piece alone, and the
|
||||
loop. The crease sheet's framing is poor; its numbers carry the result. Her Longinus panel-line screenshot was not
|
||||
available to this agent, so no side-by-side was made with it.
|
||||
|
||||
## Kernels
|
||||
|
||||
| | boolmesh 0.2.1 | manifold-csg 0.4.1 (Manifold v3.5.3) |
|
||||
|---|---|---|
|
||||
| licence | MPL-2.0 | Apache-2.0 OR MIT bindings over Apache-2.0 |
|
||||
| build | pure Rust, 14 s release on Starfire (Windows) | C++ through the -sys build script, 89 s on Yggdrasil (Linux container, `eureka-verify-rust`); fetches Manifold source by git at build time |
|
||||
| time per op | 8 to 25 ms | 13 to 20 ms |
|
||||
| output | identical vertex sets (max difference 0.0) and identical triangle counts on all 11 cases | same |
|
||||
| provenance | per-corner value carried through (0 hull, 1 cutter) | `run_original_id` with `run_index` after `as_original` |
|
||||
| intersection loop | not returned; derived from provenance | not returned; derived from provenance |
|
||||
| output before internal cleanup | not exposed (`simplify_topology` runs inside `compute_boolean`) | not exposed (`RemoveDegenerates` runs inside the op) |
|
||||
|
||||
The "naive" rows are therefore already after each kernel's own degenerate cleanup. It leaves worst angles down to
|
||||
1e-6 deg, because epsilon-length collapse does not remove slivers with long edges.
|
||||
|
||||
## Smallest changes, in order
|
||||
|
||||
1. **Measure curvature along the loop, not across it.** This is the fix. Without it the rule fails the canonical
|
||||
gun port; with it the 16-segment port passes.
|
||||
2. **Tie the cutter's tessellation to the hull's local density** (segment length about 0.2 to 0.3 h, never far
|
||||
finer). The rule keeps the tighter surface's samples; when those are much denser than the flatter surface's,
|
||||
fans remain that no merge can remove.
|
||||
3. **Split seams need a cleanup the rule does not cover.** Two sources of slivers remain. One is the owner's own
|
||||
samples near the loop. The other is the planar cap's triangulation, which matters because the caps must be kept
|
||||
for the bevelled seam. Candidates, not tested: retriangulate the cap (it is planar and interior, so free to
|
||||
remesh), and collapse owner edges shorter than the bevel width. The `-snap` variant got only part of the way:
|
||||
slivers 97 to 85, worst angle unchanged at 0.058 deg.
|
||||
4. **In a split, apply a collapse only if both pieces' guards accept it.** Replaying one piece's collapses opened a
|
||||
crack.
|
||||
|
||||
## Questions for Self (text only, not admitted)
|
||||
|
||||
1. Does "the surface with the tighter curve" mean curvature along the cut, so that the circle comes from the
|
||||
cylinder? The plan's `u = n x t` formulation gives the opposite owner for every cylinder cut. The operator should
|
||||
confirm which reading she means; this spike's renders and numbers show the two.
|
||||
2. For panel splits her rule never fires, since a plane is never tighter than the hull. Is the cleanup she does by
|
||||
hand on panel seams this same rule, or a different one (merging the hull's own near-loop vertices)? If it is
|
||||
different, the weld rule needs a second clause, and that is an operator call.
|
||||
3. Is a 5 deg worst angle in the band acceptable for the shippable bar, or does the bar want the 10 deg the guard
|
||||
uses?
|
||||
4. The path to the Longinus panel-line screenshot, for the side-by-side the plan asks for.
|
||||
5. Should the curvature come from the cage's limit surface (`X = S c`) rather than the 2-ring quadric fit? The fit is
|
||||
noisy near creases and at the saddle, but no result here turned on it.
|
||||
BIN
docs/research/spike-boolean-weld/port_flank_s16.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
docs/research/spike-boolean-weld/port_flank_s48.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
docs/research/spike-boolean-weld/probe_crease.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docs/research/spike-boolean-weld/probe_equalk_s16.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
docs/research/spike-boolean-weld/probe_saddle_s16.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
docs/research/spike-boolean-weld/probe_switch_s48.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
docs/research/spike-boolean-weld/split_fwd.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
25
spikes/boolean-weld/py/jobs.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
"""Write Blender render jobs and the cap-dropped split meshes. Usage: jobs.py <cases.json> <runs> <weld-dir>"""
|
||||
import sys, os, json, shutil, numpy as np
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from geo import *
|
||||
cases = {c['name']: c for c in json.load(open(sys.argv[1]))}; runs, wd = sys.argv[2], sys.argv[3]
|
||||
for piece in ('split_fwd_sub', 'split_fwd_int'):
|
||||
V, F = load_obj(f'{runs}/boolmesh_{piece}.obj'); T = triangulate(F)
|
||||
pr = np.array([int(x) for x in open(f'{runs}/boolmesh_{piece}.prov').read().split()])
|
||||
save_obj(f'{wd}/boolmesh_{piece}_nocap.obj', V, T[pr == 0]); shutil.copy(f'{wd}/boolmesh_{piece}_naive.loop', f'{wd}/boolmesh_{piece}_nocap.loop')
|
||||
J = []
|
||||
def port(name, scale):
|
||||
n = np.array(cases[name]['n']); n /= np.linalg.norm(n); side = np.cross(n, [0, 0, 1.0]); side /= np.linalg.norm(side) + 1e-12
|
||||
d = n + 0.35 * side
|
||||
for tag in ('naive', 'weld-across', 'weld-along'):
|
||||
J.append(f'{name}_{tag} {scale} {d[0]:.4f} {d[1]:.4f} {d[2]:.4f} boolmesh_{name}_{tag}')
|
||||
J.append(f'{name}_owner-along {scale} {n[0]:.4f} {n[1]:.4f} {n[2]:.4f} boolmesh_{name}_weld-along tubes')
|
||||
J.append(f'{name}_owner-across {scale} {n[0]:.4f} {n[1]:.4f} {n[2]:.4f} boolmesh_{name}_naive tubes')
|
||||
port('port_flank_s16', 0.07); port('port_flank_s48', 0.07); port('probe_saddle_s16', 0.07); port('probe_equalk_s16', 0.09); port('probe_switch_s48', 0.3)
|
||||
J.append('split_fwd_both-capped 0.12 0.3 0.15 1 boolmesh_split_fwd_sub_naive,boolmesh_split_fwd_int_naive')
|
||||
J.append('split_fwd_both-nocap 0.12 0.3 0.15 1 boolmesh_split_fwd_sub_nocap,boolmesh_split_fwd_int_nocap')
|
||||
J.append('split_fwd_sub-only 0.12 0.3 0.15 1 boolmesh_split_fwd_sub_naive')
|
||||
J.append('split_fwd_wire 0.12 0.3 0.15 1 boolmesh_split_fwd_sub_naive tubes')
|
||||
J.append('probe_crease_both 0.08 1 -0.3 0.25 boolmesh_probe_crease_sub_naive,boolmesh_probe_crease_int_naive')
|
||||
J.append('probe_crease_sub-only 0.08 1 -0.3 0.25 boolmesh_probe_crease_sub_naive tubes')
|
||||
open(f'{wd}/jobs.txt', 'w').write('\n'.join(J) + '\n'); print(len(J), 'jobs')
|
||||
140
spikes/boolean-weld/py/render_blender.py
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
"""Headless Blender: apply the shipped stack (Bevel 1 segment weight-limited 0.001 + Weighted Normal, settings copied
|
||||
from the cage's own modifiers) to naive and welded boolean results and render them. Run on a COPY of Ships.blend:
|
||||
blender -b Ships_copy.blend --python render_blender.py -- <weld-dir> <out-dir> <jobs.txt>
|
||||
jobs.txt lines: <png-name> <ortho-scale> <dx> <dy> <dz> <mesh-stem>[,<mesh-stem>...] [tubes]"""
|
||||
import bpy, bmesh, sys, os
|
||||
from mathutils import Vector, kdtree
|
||||
from mathutils.geometry import intersect_point_line
|
||||
|
||||
wd, outd, jobsf = sys.argv[-3:]
|
||||
os.makedirs(outd, exist_ok=True)
|
||||
cage = bpy.data.objects['Dexter Quiet Cage']
|
||||
bev_src = next(m for m in cage.modifiers if m.type == 'BEVEL')
|
||||
wn_src = next(m for m in cage.modifiers if m.type == 'WEIGHTED_NORMAL')
|
||||
for m in cage.modifiers:
|
||||
if m.type in ('BEVEL', 'WEIGHTED_NORMAL'):
|
||||
m.show_viewport = False
|
||||
dg = bpy.context.evaluated_depsgraph_get()
|
||||
me = cage.evaluated_get(dg).to_mesh()
|
||||
att = me.attributes.get('bevel_weight_edge')
|
||||
segs = []
|
||||
for e in me.edges:
|
||||
w = att.data[e.index].value if att else 0.0
|
||||
if w > 0:
|
||||
segs.append((cage.matrix_world @ me.vertices[e.vertices[0]].co, cage.matrix_world @ me.vertices[e.vertices[1]].co, w))
|
||||
print('CAGE weighted edges', len(segs), 'smooth', [p.use_smooth for p in me.polygons][:1])
|
||||
# Diagnostic: compare the cage's bevel-weight edges with the crease edges exported with the hull fixture.
|
||||
fx = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'fixtures')
|
||||
HV = [Vector(tuple(map(float, l.split()[1:4]))) for l in open(fx + '/hull_nobevel.obj') if l.startswith('v ')]
|
||||
csegs = [(HV[int(a)], HV[int(b)]) for a, b in (l.split() for l in open(fx + '/hull_creases.txt') if l.strip())]
|
||||
ck = kdtree.KDTree(len(csegs))
|
||||
for i, (a, b) in enumerate(csegs):
|
||||
ck.insert((a + b) / 2, i)
|
||||
ck.balance()
|
||||
dmax = max((ck.find((a + b) / 2)[2] for a, b, w in segs), default=0)
|
||||
print('BEVEL-vs-CREASE max midpoint distance', dmax, 'weights', sorted({round(w, 3) for a, b, w in segs}))
|
||||
segs = [(a, b, 1.0) for a, b in csegs]
|
||||
kd = kdtree.KDTree(len(segs))
|
||||
for i, (a, b, w) in enumerate(segs):
|
||||
kd.insert((a + b) / 2, i)
|
||||
kd.balance()
|
||||
maxlen = max(((a - b).length for a, b, w in segs), default=0)
|
||||
|
||||
scene = bpy.data.scenes.new('spike')
|
||||
bpy.context.window.scene = scene
|
||||
scene.render.engine = 'BLENDER_WORKBENCH'
|
||||
scene.display.shading.light = 'STUDIO'
|
||||
scene.display.shading.color_type = 'MATERIAL'
|
||||
scene.display.shading.show_specular_highlight = True
|
||||
scene.render.resolution_x = scene.render.resolution_y = 700
|
||||
scene.world = bpy.data.worlds.new('w')
|
||||
cam = bpy.data.objects.new('cam', bpy.data.cameras.new('cam'))
|
||||
cam.data.type = 'ORTHO'
|
||||
scene.collection.objects.link(cam)
|
||||
scene.camera = cam
|
||||
grey = bpy.data.materials.new('grey'); grey.diffuse_color = (0.75, 0.75, 0.78, 1)
|
||||
cmat = bpy.data.materials.new('cut'); cmat.diffuse_color = (0.62, 0.66, 0.75, 1)
|
||||
own = [bpy.data.materials.new('own_hull'), bpy.data.materials.new('own_cutter'), bpy.data.materials.new('own_none')]
|
||||
own[0].diffuse_color = (0.1, 0.35, 1.0, 1); own[1].diffuse_color = (1.0, 0.45, 0.05, 1); own[2].diffuse_color = (0.2, 0.2, 0.2, 1)
|
||||
|
||||
|
||||
def load(stem):
|
||||
V, F = [], []
|
||||
for line in open(f'{wd}/{stem}.obj'):
|
||||
s = line.split()
|
||||
if s and s[0] == 'v':
|
||||
V.append(tuple(map(float, s[1:4])))
|
||||
elif s and s[0] == 'f':
|
||||
F.append(tuple(int(x) - 1 for x in s[1:]))
|
||||
loop = [tuple(map(int, l.split())) for l in open(f'{wd}/{stem}.loop') if l.strip()]
|
||||
return V, F, loop
|
||||
|
||||
|
||||
def build(stem, tubes):
|
||||
V, F, loop = load(stem)
|
||||
used = sorted({i for f in F for i in f}); remap = {o: n for n, o in enumerate(used)}
|
||||
m = bpy.data.meshes.new(stem)
|
||||
m.from_pydata([V[i] for i in used], [], [tuple(remap[i] for i in f) for f in F])
|
||||
m.materials.append(grey)
|
||||
ob = bpy.data.objects.new(stem, m); scene.collection.objects.link(ob)
|
||||
bm = bmesh.new(); bm.from_mesh(m)
|
||||
bw = bm.edges.layers.float.get('bevel_weight_edge') or bm.edges.layers.float.new('bevel_weight_edge')
|
||||
loopset = {(min(remap[a], remap[b]), max(remap[a], remap[b])) for a, b, o in loop if a in remap and b in remap}
|
||||
nloop = nhull = 0
|
||||
for e in bm.edges:
|
||||
k = (min(e.verts[0].index, e.verts[1].index), max(e.verts[0].index, e.verts[1].index))
|
||||
if k in loopset:
|
||||
e[bw] = 1.0; nloop += 1; continue
|
||||
mid = (e.verts[0].co + e.verts[1].co) / 2
|
||||
for co, i, d in kd.find_range(mid, maxlen):
|
||||
a, b, w = segs[i]
|
||||
ok = True
|
||||
for v in e.verts:
|
||||
p, t = intersect_point_line(v.co, a, b)
|
||||
if (p - v.co).length > 1e-6 or t < -1e-6 or t > 1 + 1e-6:
|
||||
ok = False
|
||||
if ok:
|
||||
e[bw] = w; nhull += 1; break
|
||||
for f in bm.faces:
|
||||
f.smooth = True
|
||||
bm.to_mesh(m); bm.free()
|
||||
b = ob.modifiers.new('Bevel', 'BEVEL')
|
||||
for k in ('width', 'segments', 'limit_method', 'offset_type', 'profile', 'harden_normals', 'miter_outer', 'miter_inner', 'clamp_overlap', 'loop_slide'):
|
||||
if hasattr(bev_src, k):
|
||||
setattr(b, k, getattr(bev_src, k))
|
||||
w = ob.modifiers.new('WeightedNormal', 'WEIGHTED_NORMAL')
|
||||
for k in ('mode', 'weight', 'thresh', 'keep_sharp', 'use_face_influence'):
|
||||
if hasattr(wn_src, k):
|
||||
setattr(w, k, getattr(wn_src, k))
|
||||
print('BUILT', stem, 'loop edges', nloop, 'hull weighted edges', nhull)
|
||||
objs = [ob]
|
||||
if tubes:
|
||||
cu = bpy.data.curves.new(stem + '_own', 'CURVE'); cu.dimensions = '3D'; cu.bevel_depth = 0.0006
|
||||
for i in range(3):
|
||||
cu.materials.append(own[i])
|
||||
for a, bb, o in loop:
|
||||
sp = cu.splines.new('POLY'); sp.points.add(1)
|
||||
sp.points[0].co = (*V[a], 1); sp.points[1].co = (*V[bb], 1); sp.material_index = o if o in (0, 1) else 2
|
||||
co = bpy.data.objects.new(stem + '_own', cu); scene.collection.objects.link(co); objs.append(co)
|
||||
return objs, [Vector(V[a]) for a, b, o in loop]
|
||||
|
||||
|
||||
for line in open(jobsf):
|
||||
s = line.split()
|
||||
if not s or s[0].startswith('#'):
|
||||
continue
|
||||
png, scale, d = s[0], float(s[1]), Vector(tuple(map(float, s[2:5]))).normalized()
|
||||
stems = s[5].split(','); tubes = len(s) > 6 and s[6] == 'tubes'
|
||||
objs, pts = [], []
|
||||
for st in stems:
|
||||
o, p = build(st, tubes); objs += o; pts += p
|
||||
target = max(pts, key=lambda p: p.dot(d)) if s[0].startswith('split') or 'crease' in s[0] else sum(pts, Vector()) / len(pts)
|
||||
cam.location = target + d * 2.0
|
||||
cam.rotation_euler = (-d).to_track_quat('-Z', 'Y').to_euler()
|
||||
cam.data.ortho_scale = scale; cam.data.clip_end = 10
|
||||
scene.render.filepath = f'{outd}/{png}.png'
|
||||
bpy.ops.render.render(write_still=True)
|
||||
print('RENDERED', png)
|
||||
for o in objs:
|
||||
bpy.data.objects.remove(o, do_unlink=True)
|
||||
print('ALLDONE')
|
||||
95
spikes/boolean-weld/py/run.py
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
"""Run the weld variants and measures over every case and kernel. Usage: run.py <fixtures> <cases.json> <runs-dir> <out-dir>"""
|
||||
import sys, os, json, numpy as np
|
||||
from scipy.spatial import cKDTree
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from geo import *
|
||||
from weld import *
|
||||
|
||||
fx, casesf, runs, outd = sys.argv[1:5]
|
||||
kernels = sys.argv[5].split(',') if len(sys.argv) > 5 else ['boolmesh', 'manifold']
|
||||
os.makedirs(outd, exist_ok=True)
|
||||
hull = Hull(fx)
|
||||
TOL = 1e-7 * hull.diag * 10
|
||||
cases = {c['name']: c for c in json.load(open(casesf))}
|
||||
VARIANTS = [('across', 'literal'), ('across', 'looponly'), ('along', 'literal'), ('along', 'looponly'), ('along', 'looponly-snap'), ('across', 'looponly-snap')]
|
||||
rows, owners = [], {}
|
||||
|
||||
|
||||
def load_run(kernel, name):
|
||||
V, F = load_obj(f'{runs}/{kernel}_{name}.obj'); T = triangulate(F)
|
||||
prov = np.array([int(x) for x in open(f'{runs}/{kernel}_{name}.prov').read().split()])
|
||||
return V, T, prov
|
||||
|
||||
|
||||
def ref_points(c, kernel, V, T, prov):
|
||||
if c['kind'] == 'cyl':
|
||||
Vr, Tr, pr = load_run('boolmesh', c['name'] + '_REF')
|
||||
return densify(Vr, loops_of(Tr, pr)[0], 4)
|
||||
return densify(V, loops_of(T, prov)[0], 64)
|
||||
|
||||
|
||||
def owner_summary(info, loops):
|
||||
sw = 0
|
||||
for L in loops:
|
||||
o = [info[v]['owner'] for v in L]; sw += sum(o[i] != o[i - 1] for i in range(len(o)))
|
||||
ks = np.array([[info[v]['kh'], info[v]['kc']] for L in loops for v in L])
|
||||
fin = np.isfinite(ks[:, 0])
|
||||
return dict(hull_owned=int(sum(info[v]['owner'] == 0 for v in info)), cutter_owned=int(sum(info[v]['owner'] == 1 for v in info)),
|
||||
switches=int(sw), crease_loop_verts=int(sum(info[v]['crease'] for v in info)),
|
||||
kh_abs_median=float(np.median(np.abs(ks[fin, 0]))) if fin.any() else None,
|
||||
kc_abs_median=float(np.median(np.abs(ks[:, 1]))),
|
||||
near_tie=int(np.sum(np.abs(np.abs(ks[fin, 0]) - np.abs(ks[fin, 1])) < 0.1 * np.maximum(np.abs(ks[fin, 0]), np.abs(ks[fin, 1])) + 1e-9)),
|
||||
origins={o: int(sum(info[v]['origin'] == o for v in info)) for o in ('H', 'C', 'HC', 'X')})
|
||||
|
||||
|
||||
def save_for_blender(path, V, T, prov, info=None):
|
||||
save_obj(path + '.obj', V[np.unique(T)] if False else V, T)
|
||||
loops, le = loops_of(T, prov)
|
||||
with open(path + '.loop', 'w') as f:
|
||||
for a, b in le:
|
||||
oa = info[a]['owner'] if info and a in info else -1
|
||||
f.write(f'{a} {b} {oa}\n')
|
||||
|
||||
|
||||
for name, c in cases.items():
|
||||
for kernel in kernels:
|
||||
if not os.path.exists(f'{runs}/{kernel}_{name}.obj'):
|
||||
continue
|
||||
V, T, prov = load_run(kernel, name)
|
||||
cut = Cutter(c)
|
||||
refp = ref_points(c, kernel, V, T, prov)
|
||||
m = measures(V, T, prov, hull, cut, refp)
|
||||
rows.append(dict(case=name, kernel=kernel, variant='naive', **m))
|
||||
for mode in ('across', 'along', 'mean'):
|
||||
loops, le, info = analyse_loops(V, T, prov, hull, cut, mode, TOL)
|
||||
owners[f'{name}|{kernel}|{mode}'] = owner_summary(info, loops)
|
||||
if kernel == 'boolmesh' and mode == 'across':
|
||||
save_for_blender(f'{outd}/{kernel}_{name}_naive', V, T, prov, info)
|
||||
for mode, scope in VARIANTS:
|
||||
T2, P2, done, st, (loops, le, info) = weld(V, T, prov, hull, cut, mode, scope, TOL)
|
||||
crease_removed = sum(1 for a, b in done if hull.edge_of(a, TOL) in hull.crease or (hull.kd.query(a)[0] < TOL and int(hull.kd.query(a)[1]) in hull.crease_v))
|
||||
m2 = measures(V, T2, P2, hull, cut, refp, removed=done)
|
||||
row = dict(case=name, kernel=kernel, variant=f'{mode}-{scope}', collapses=len(done), crease_verts_removed=crease_removed,
|
||||
stats=st, **m2)
|
||||
if c['kind'] == 'box' and c['op'] == 'sub':
|
||||
# split: replay the same collapses on the other piece and compare the two loops
|
||||
other = name[:-4] + '_int'
|
||||
Vo, To, po = load_run(kernel, other)
|
||||
To2, Po2, done_o, st_o, _ = weld(Vo, To, po, hull, cut, mode, scope, TOL, forced=done)
|
||||
la = densify(V, loops_of(T2, P2)[0], 1); lb = densify(Vo, loops_of(To2, Po2)[0], 1)
|
||||
gap = max(cKDTree(lb).query(la)[0].max(), cKDTree(la).query(lb)[0].max())
|
||||
row.update(split_replay=st_o, split_loop_gap=float(gap), split_loop_verts=(len(la), len(lb)))
|
||||
if mode == 'along' and scope in ('looponly', 'looponly-snap') and kernel == 'boolmesh':
|
||||
save_for_blender(f'{outd}/{kernel}_{other}_weld-{mode}' + ('-snap' if 'snap' in scope else ''), Vo, To2, Po2)
|
||||
rows.append(row)
|
||||
if kernel == 'boolmesh' and scope.startswith('looponly'):
|
||||
save_for_blender(f'{outd}/{kernel}_{name}_weld-{mode}' + ('-snap' if 'snap' in scope else ''), V, T2, P2, info)
|
||||
if c['kind'] == 'box' and c['op'] == 'sub':
|
||||
Vo, To, po = load_run(kernel, name[:-4] + '_int')
|
||||
la = densify(V, loops_of(T, prov)[0], 1); lb = densify(Vo, loops_of(To, po)[0], 1)
|
||||
rows.append(dict(case=name, kernel=kernel, variant='naive-split-gap',
|
||||
split_loop_gap=float(max(cKDTree(lb).query(la)[0].max(), cKDTree(la).query(lb)[0].max())), split_loop_verts=(len(la), len(lb))))
|
||||
print('done', name, kernel, flush=True)
|
||||
|
||||
import weld as W
|
||||
json.dump(dict(rows=rows, owners=owners, flips=W.FLIPS), open(f'{outd}/measures.json', 'w'), indent=1, default=float)
|
||||
31
spikes/boolean-weld/py/sliverside.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
"""Sliver breakdown by side (hull face vs cutter face) within the band, for saved Blender meshes."""
|
||||
import sys, os, glob, numpy as np
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from geo import *
|
||||
from weld import Hull, loops_of, densify, angles
|
||||
from scipy.spatial import cKDTree
|
||||
hull = Hull(sys.argv[1]); runs, wd = sys.argv[2], sys.argv[3]
|
||||
for name in sys.argv[4:]:
|
||||
for tag in ('naive', 'weld-along', 'weld-across'):
|
||||
p = f'{wd}/boolmesh_{name}_{tag}.obj'
|
||||
if not os.path.exists(p): continue
|
||||
V, F = load_obj(p); T = triangulate(F)
|
||||
# provenance: faces adjacent to cutter in the saved run; recover by matching to the raw run's faces
|
||||
Vr, Fr = load_obj(f'{runs}/boolmesh_{name}.obj'); Tr = triangulate(Fr)
|
||||
pr = np.array([int(x) for x in open(f'{runs}/boolmesh_{name}.prov').read().split()])
|
||||
key = {tuple(sorted(t)): pr[i] for i, t in enumerate(Tr)}
|
||||
prov = np.array([key.get(tuple(sorted(t)), -1) for t in T])
|
||||
# faces changed by the weld: inherit by vertex majority of the raw run's faces
|
||||
unk = prov < 0
|
||||
vside = np.zeros(len(V)); cnt = np.zeros(len(V))
|
||||
for i, t in enumerate(Tr):
|
||||
for v in t: vside[v] += pr[i]; cnt[v] += 1
|
||||
vs = vside / np.maximum(cnt, 1)
|
||||
for i in np.where(unk)[0]: prov[i] = int(round(vs[T[i]].mean()))
|
||||
loops, _ = loops_of(T, prov); lv = sorted({v for L in loops for v in L})
|
||||
h = float(np.median(hull.vlen[hull.kd.query(V[lv])[1]])); kd = cKDTree(densify(V, loops))
|
||||
cen = V[T].mean(1); inb = kd.query(cen)[0] < 2 * h
|
||||
FN, FA = face_normals(V, T); lmax = np.linalg.norm(V[T] - V[np.roll(T, -1, 1)], axis=2).max(1)
|
||||
sl = ((lmax ** 2 / np.maximum(2 * FA, 1e-300) > 10) | (FA < 1e-4 * FA.mean())) & inb
|
||||
mins = {s: (min([min(angles(V[t])) for t in T[inb & (prov == s)]], default=None)) for s in (0, 1)}
|
||||
print(f'{name:18s} {tag:12s} slivers hull={int((sl & (prov==0)).sum())} cutter={int((sl & (prov==1)).sum())} min-angle hull={mins[0]:.3g} cutter={mins[1]:.3g}')
|
||||
22
spikes/boolean-weld/py/table.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Print measures.json as Markdown tables. Usage: table.py <measures.json> [kernel]"""
|
||||
import sys, json
|
||||
d = json.load(open(sys.argv[1])); kern = sys.argv[2] if len(sys.argv) > 2 else None
|
||||
cols = ['case', 'kernel', 'variant', 'collapses', 'tris_band', 'tris_total', 'slivers_band', 'min_angle_band', 'p5_angle_band',
|
||||
'flipped_hull_band', 'dev_mean_pct', 'dev_max_pct', 'dev_max_h', 'ref_to_loop_max_pct', 'outside_band_moved', 'crease_verts_removed', 'split_loop_gap']
|
||||
print('| ' + ' | '.join(cols) + ' |'); print('|' + '---|' * len(cols))
|
||||
def f(v):
|
||||
if v is None: return ''
|
||||
if isinstance(v, float): return f'{v:.3g}'
|
||||
return str(v)
|
||||
for r in d['rows']:
|
||||
if kern and r['kernel'] != kern: continue
|
||||
print('| ' + ' | '.join(f(r.get(c)) for c in cols) + ' |')
|
||||
print()
|
||||
print('| case/kernel/mode | hull-owned | cutter-owned | switches | near-tie | crease loop verts | median abs k_hull | median abs k_cutter | origins |')
|
||||
print('|---|---|---|---|---|---|---|---|---|')
|
||||
for k, o in d['owners'].items():
|
||||
if kern and k.split('|')[1] != kern: continue
|
||||
print(f"| {k} | {o['hull_owned']} | {o['cutter_owned']} | {o['switches']} | {o['near_tie']} | {o['crease_loop_verts']} | {f(o['kh_abs_median'])} | {f(o['kc_abs_median'])} | {o['origins']} |")
|
||||
if len(sys.argv) > 3:
|
||||
for r in d['rows']:
|
||||
if 'stats' in r and (not kern or r['kernel'] == kern): print(r['case'], r['variant'], r['stats'], r.get('split_replay', ''))
|
||||
320
spikes/boolean-weld/py/weld.py
Normal file
|
|
@ -0,0 +1,320 @@
|
|||
"""Weld pass for the boolean-weld spike: the operator rule, automated, plus the measures.
|
||||
|
||||
Rule (ruling boolean-cleanup-tighter-curve-wins, plan steps 1-5): along the intersection loop the surface with
|
||||
the larger |normal curvature| owns the loop; the yielding surface's spare vertices collapse onto the owner's loop
|
||||
vertices, each collapse guarded (no flip, worst angle not driven below 10 deg, link condition).
|
||||
Curvature direction modes: 'across' (plan: u = n x t), 'along' (t projected into each surface), 'mean'.
|
||||
Scope variants: 'literal' (loop vertices from the yielding side's edges AND the yielding side's one-ring),
|
||||
'looponly' (loop vertices from the yielding side's edges only). Scratch code."""
|
||||
import sys, os, numpy as np
|
||||
from collections import defaultdict
|
||||
from scipy.spatial import cKDTree
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
from geo import *
|
||||
|
||||
MIN_ANGLE = 10.0
|
||||
SNAP = 0.25
|
||||
BEVEL_W = 0.001
|
||||
|
||||
|
||||
def seg_dist(x, a, b):
|
||||
ab = b - a
|
||||
t = np.clip((x - a) @ ab / max(ab @ ab, 1e-300), 0, 1)
|
||||
return np.linalg.norm(x - (a + t * ab))
|
||||
|
||||
|
||||
def tri_dist(p, P):
|
||||
a, b, c = P
|
||||
ab, ac, ap = b - a, c - a, p - a
|
||||
n = np.cross(ab, ac); nn = n @ n
|
||||
if nn < 1e-300:
|
||||
return 1e9, (1 / 3, 1 / 3, 1 / 3)
|
||||
q = p - (ap @ n) / nn * n
|
||||
v0, v1, v2 = ab, ac, q - a
|
||||
d00, d01, d11, d20, d21 = v0 @ v0, v0 @ v1, v1 @ v1, v2 @ v0, v2 @ v1
|
||||
den = d00 * d11 - d01 * d01
|
||||
v = (d11 * d20 - d01 * d21) / den; w = (d00 * d21 - d01 * d20) / den; u = 1 - v - w
|
||||
if min(u, v, w) >= -1e-9:
|
||||
return np.linalg.norm(p - q), (u, v, w)
|
||||
d = min(seg_dist(p, a, b), seg_dist(p, b, c), seg_dist(p, a, c))
|
||||
bw = np.clip([u, v, w], 0, None); bw = bw / bw.sum()
|
||||
return d, tuple(bw)
|
||||
|
||||
|
||||
class Hull:
|
||||
def __init__(s, fx):
|
||||
V, F = load_obj(fx + '/hull_nobevel.obj'); s.V, s.T = V, triangulate(F)
|
||||
s.S = np.load(fx + '/../_curv.npy'); s.N = vertex_normals(s.V, s.T); s.FN, _ = face_normals(s.V, s.T)
|
||||
s.kd = cKDTree(V); s.adj = vertex_adj(s.T, len(V))
|
||||
s.vf = defaultdict(list)
|
||||
for fi, t in enumerate(s.T):
|
||||
for v in t:
|
||||
s.vf[int(v)].append(fi)
|
||||
E = np.loadtxt(fx + '/hull_creases.txt', dtype=int)
|
||||
s.crease = {(min(a, b), max(a, b)) for a, b in E}
|
||||
s.crease_v = set(np.unique(E).tolist())
|
||||
s.diag = np.linalg.norm(V.max(0) - V.min(0))
|
||||
el = defaultdict(list)
|
||||
for a, b in edge_faces(s.T):
|
||||
l = np.linalg.norm(V[a] - V[b]); el[a].append(l); el[b].append(l)
|
||||
s.vlen = np.array([np.mean(el[i]) for i in range(len(V))])
|
||||
|
||||
def edge_of(s, x, tol):
|
||||
_, idx = s.kd.query(x, 6)
|
||||
best = None
|
||||
for a in idx:
|
||||
for b in s.adj[a]:
|
||||
d = seg_dist(x, s.V[a], s.V[b])
|
||||
if d < tol and (best is None or d < best[0]):
|
||||
best = (d, (min(a, b), max(a, b)))
|
||||
return best[1] if best else None
|
||||
|
||||
def frame(s, x):
|
||||
_, idx = s.kd.query(x, 4)
|
||||
bestf, bd, bw = None, 1e9, None
|
||||
for a in idx:
|
||||
for f in s.vf[int(a)]:
|
||||
d, w = tri_dist(x, s.V[s.T[f]])
|
||||
if d < bd:
|
||||
bestf, bd, bw = f, d, w
|
||||
vs = s.T[bestf]
|
||||
Sx = sum(w * s.S[v] for w, v in zip(bw, vs))
|
||||
n = sum(w * s.N[v] for w, v in zip(bw, vs)); n = n / np.linalg.norm(n)
|
||||
return n, Sx, bestf
|
||||
|
||||
|
||||
class Cutter:
|
||||
def __init__(s, c):
|
||||
s.c = c; s.kind = c['kind']
|
||||
Vc, Fc = load_obj(c['cutter']); s.V, s.T = Vc, triangulate(Fc); s.adj = vertex_adj(s.T, len(Vc))
|
||||
if s.kind == 'cyl':
|
||||
s.p, s.r = np.array(c['p']), c['r']
|
||||
s.a = np.array(c['n']) / np.linalg.norm(c['n'])
|
||||
|
||||
def edge_of(s, x, tol):
|
||||
best = None
|
||||
for a in range(len(s.V)):
|
||||
for b in s.adj[a]:
|
||||
if b < a:
|
||||
continue
|
||||
d = seg_dist(x, s.V[a], s.V[b])
|
||||
if d < tol and (best is None or d < best[0]):
|
||||
best = (d, (a, b))
|
||||
return best[1] if best else None
|
||||
|
||||
def frame(s, x):
|
||||
if s.kind == 'cyl':
|
||||
d = x - s.p; er = d - (d @ s.a) * s.a; er = er / np.linalg.norm(er)
|
||||
et = np.cross(s.a, er)
|
||||
return er, np.outer(et, et) / s.r
|
||||
lo, hi = np.array(s.c['lo']), np.array(s.c['hi'])
|
||||
dd = np.concatenate([x - lo, hi - x]); i = int(np.argmin(np.abs(dd)))
|
||||
n = np.zeros(3); n[i % 3] = -1 if i < 3 else 1
|
||||
return n, np.zeros((3, 3))
|
||||
|
||||
|
||||
def loops_of(T, prov):
|
||||
ef = edge_faces(T)
|
||||
le = [e for e, fs in ef.items() if len(fs) == 2 and prov[fs[0]] != prov[fs[1]]]
|
||||
g = defaultdict(list)
|
||||
for a, b in le:
|
||||
g[a].append(b); g[b].append(a)
|
||||
seen, loops = set(), []
|
||||
for s0 in g:
|
||||
if s0 in seen:
|
||||
continue
|
||||
L = [s0]; seen.add(s0); prev, cur = None, s0
|
||||
while True:
|
||||
nx = [x for x in g[cur] if x != prev and x not in seen]
|
||||
if not nx:
|
||||
break
|
||||
prev, cur = cur, nx[0]; L.append(cur); seen.add(cur)
|
||||
loops.append(L)
|
||||
return loops, le
|
||||
|
||||
|
||||
def kvals(mode, n, S, t):
|
||||
if mode == 'mean':
|
||||
return float(np.trace(S) / 2)
|
||||
if mode == 'along':
|
||||
tt = t - (t @ n) * n; tt = tt / np.linalg.norm(tt)
|
||||
return float(tt @ S @ tt)
|
||||
u = np.cross(n, t); u = u / np.linalg.norm(u)
|
||||
return float(u @ S @ u)
|
||||
|
||||
|
||||
def analyse_loops(V, T, prov, hull, cut, mode, tol):
|
||||
loops, le = loops_of(T, prov)
|
||||
info = {}
|
||||
for L in loops:
|
||||
n = len(L)
|
||||
for i, v in enumerate(L):
|
||||
x = V[v]
|
||||
t = V[L[(i + 1) % n]] - V[L[i - 1]]; t = t / np.linalg.norm(t)
|
||||
he = hull.edge_of(x, tol); ce = cut.edge_of(x, tol)
|
||||
nh, Sh, _ = hull.frame(x); nc, Sc = cut.frame(x)
|
||||
crease = he is not None and he in hull.crease
|
||||
kh = np.inf if crease else kvals(mode, nh, Sh, t)
|
||||
kc = kvals(mode, nc, Sc, t)
|
||||
origin = (('H' if he else '') + ('C' if ce else '')) or 'X'
|
||||
info[v] = dict(kh=kh, kc=kc, owner=0 if abs(kh) >= abs(kc) else 1, origin=origin, crease=crease)
|
||||
return loops, le, info
|
||||
|
||||
|
||||
def angles(P):
|
||||
a, b, c = P; out = []
|
||||
for p, q, r in ((a, b, c), (b, c, a), (c, a, b)):
|
||||
u, w = q - p, r - p
|
||||
out.append(np.degrees(np.arccos(np.clip(u @ w / max(np.linalg.norm(u) * np.linalg.norm(w), 1e-300), -1, 1))))
|
||||
return out
|
||||
|
||||
|
||||
def try_collapse(V, faces, vf, v, w, stats):
|
||||
"""Merge vertex v into w (w keeps its position). Guards: edge exists, link condition, no flip, worst angle."""
|
||||
fv = [f for f in vf[v] if faces[f] is not None]
|
||||
fw = [f for f in vf[w] if faces[f] is not None]
|
||||
shared = [f for f in fv if w in faces[f]]
|
||||
if not shared:
|
||||
stats['refused_not_edge'] += 1; return False
|
||||
nv = {x for f in fv for x in faces[f]} - {v}
|
||||
nw = {x for f in fw for x in faces[f]} - {w}
|
||||
opp = {x for f in shared for x in faces[f]} - {v, w}
|
||||
if (nv & nw) != opp:
|
||||
stats['refused_link'] += 1; return False
|
||||
for f in fv:
|
||||
if f in shared:
|
||||
continue
|
||||
P = V[faces[f]]; old = np.cross(P[1] - P[0], P[2] - P[0])
|
||||
Q = np.array([V[w] if x == v else V[x] for x in faces[f]]); new = np.cross(Q[1] - Q[0], Q[2] - Q[0])
|
||||
if old @ new <= 0:
|
||||
stats['refused_flip'] += 1; return False
|
||||
na, oa = min(angles(Q)), min(angles(P))
|
||||
if na < MIN_ANGLE and na < oa:
|
||||
stats['refused_angle'] += 1; return False
|
||||
for f in shared:
|
||||
faces[f] = None
|
||||
for f in fv:
|
||||
if faces[f] is None:
|
||||
continue
|
||||
faces[f] = [w if x == v else x for x in faces[f]]; vf[w].append(f)
|
||||
vf[v] = []; stats['collapsed'] += 1
|
||||
return True
|
||||
|
||||
|
||||
def weld(V, T, prov, hull, cut, mode, scope, tol, forced=None):
|
||||
"""Returns new (T, prov), the collapses [(pos_v, pos_w)], stats, loop analysis. `forced` replays a collapse
|
||||
list by position (split: the second piece gets the first piece's collapses)."""
|
||||
loops, le, info = analyse_loops(V, T, prov, hull, cut, mode, tol)
|
||||
faces = [list(map(int, t)) for t in T]; vf = defaultdict(list)
|
||||
for fi, t in enumerate(faces):
|
||||
for x in t:
|
||||
vf[x].append(fi)
|
||||
stats = defaultdict(int); done = []
|
||||
if forced is not None:
|
||||
kd = cKDTree(V)
|
||||
for pv, pw in forced:
|
||||
dv, v = kd.query(pv); dw, w = kd.query(pw)
|
||||
if dv > tol or dw > tol:
|
||||
stats['replay_unmatched'] += 1; continue
|
||||
if try_collapse(V, faces, vf, int(v), int(w), stats):
|
||||
done.append((V[v].copy(), V[w].copy()))
|
||||
else:
|
||||
cand = []
|
||||
for L in loops:
|
||||
n = len(L)
|
||||
for i, v in enumerate(L):
|
||||
inf = info[v]; own = inf['owner']
|
||||
ychar = 'C' if own == 0 else 'H'; ochar = 'H' if own == 0 else 'C'
|
||||
if inf['origin'] == ychar:
|
||||
best = None
|
||||
for step in (1, -1):
|
||||
for j in range(1, n):
|
||||
u = L[(i + step * j) % n]
|
||||
if ochar in info[u]['origin']:
|
||||
d = np.linalg.norm(V[u] - V[v])
|
||||
if best is None or d < best[0]:
|
||||
best = (d, u)
|
||||
break
|
||||
if best:
|
||||
cand.append((best[0], v, best[1], 'loop'))
|
||||
if scope == 'literal':
|
||||
loopset = set(info)
|
||||
for v, inf in info.items():
|
||||
ys = 1 - inf['owner']
|
||||
for f in vf[v]:
|
||||
if prov[f] != ys:
|
||||
continue
|
||||
for x in faces[f]:
|
||||
if x in loopset or any(prov[g] != ys for g in vf[x]):
|
||||
continue
|
||||
cand.append((np.linalg.norm(V[x] - V[v]), x, v, 'ring'))
|
||||
if scope.endswith('snap'):
|
||||
# candidate change, not her rule: owner-side vertices off the loop but within SNAP x local edge length
|
||||
# of a loop vertex collapse onto it (removes the slivers a cut leaves next to an existing vertex)
|
||||
loopset = set(info)
|
||||
for v in info:
|
||||
for f in vf[v]:
|
||||
for x in faces[f]:
|
||||
if x in loopset: continue
|
||||
d = np.linalg.norm(V[x] - V[v]); hl = hull.vlen[hull.kd.query(V[x])[1]]
|
||||
if d < SNAP * hl: cand.append((d, x, v, 'snap'))
|
||||
# and loop edges shorter than the bevel width: merge the later loop vertex into the earlier one
|
||||
for L in loops:
|
||||
for i in range(len(L)):
|
||||
a, b = L[i], L[(i + 1) % len(L)]; d = np.linalg.norm(V[a] - V[b])
|
||||
if d < BEVEL_W: cand.append((d, b, a, 'shortloop'))
|
||||
cand.sort(key=lambda z: z[0])
|
||||
removed = set()
|
||||
for d, v, w, kind in cand:
|
||||
if v in removed or w in removed:
|
||||
stats['skipped_gone'] += 1; continue
|
||||
stats['cand_' + kind] += 1
|
||||
if try_collapse(V, faces, vf, v, w, stats):
|
||||
removed.add(v); done.append((V[v].copy(), V[w].copy()))
|
||||
keep = [i for i, f in enumerate(faces) if f is not None]
|
||||
T2 = np.array([faces[i] for i in keep]); P2 = np.array([prov[i] for i in keep])
|
||||
return T2, P2, done, dict(stats), (loops, le, info)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- measures
|
||||
def densify(V, loops, per=16):
|
||||
pts = []
|
||||
for L in loops:
|
||||
for i in range(len(L)):
|
||||
a, b = V[L[i]], V[L[(i + 1) % len(L)]]
|
||||
pts += [a + (b - a) * s for s in np.linspace(0, 1, per, endpoint=False)]
|
||||
return np.array(pts)
|
||||
|
||||
|
||||
FLIPS = []
|
||||
|
||||
def measures(V, T, prov, hull, cut, ref_pts, removed=(), tol=1e-7):
|
||||
loops, le = loops_of(T, prov)
|
||||
lv = sorted({v for L in loops for v in L})
|
||||
h = float(np.median(hull.vlen[hull.kd.query(V[lv])[1]]))
|
||||
band = 2 * h
|
||||
dense = densify(V, loops); kd = cKDTree(dense)
|
||||
T = np.asarray(T); cen = V[T].mean(1); inb = kd.query(cen)[0] < band
|
||||
FN, FA = face_normals(V, T); meanA = FA.mean()
|
||||
lmax = np.linalg.norm(V[T] - V[np.roll(T, -1, 1)], axis=2).max(1)
|
||||
AR = lmax ** 2 / np.maximum(2 * FA, 1e-300)
|
||||
sliver = ((AR > 10) | (FA < 1e-4 * meanA)) & inb
|
||||
ang = np.array([min(angles(V[t])) for t in T[inb]])
|
||||
flips = 0
|
||||
for fi in np.where(inb)[0]:
|
||||
if prov[fi] == 0:
|
||||
n, _, hf = hull.frame(cen[fi])
|
||||
if FN[fi] @ n < 0:
|
||||
flips += 1; near_crease = min(np.linalg.norm(hull.V[list(hull.crease_v)] - cen[fi], axis=1)) / h
|
||||
FLIPS.append(dict(c=cen[fi].tolist(), dot=float(FN[fi] @ n), dot_face=float(FN[fi] @ hull.FN[hf]), crease_dist_h=float(near_crease)))
|
||||
dref = cKDTree(ref_pts)
|
||||
d_tr = dref.query(dense)[0]; d_rt = kd.query(ref_pts)[0]
|
||||
moved_out = [r for r in removed if kd.query(r[0])[0] >= band and hull.kd.query(r[0])[0] < tol]
|
||||
return dict(h_local=h, tris_band=int(inb.sum()), tris_total=int(len(T)), slivers_band=int(sliver.sum()),
|
||||
min_angle_band=float(ang.min()), p5_angle_band=float(np.percentile(ang, 5)), flipped_hull_band=int(flips),
|
||||
loops=len(loops), loop_verts=len(lv),
|
||||
dev_mean_pct=float(d_tr.mean() / hull.diag * 100), dev_max_pct=float(d_tr.max() / hull.diag * 100),
|
||||
dev_mean_h=float(d_tr.mean() / h), dev_max_h=float(d_tr.max() / h),
|
||||
ref_to_loop_max_pct=float(d_rt.max() / hull.diag * 100),
|
||||
outside_band_moved=len(moved_out),
|
||||
outside_band_max_disp=float(max([np.linalg.norm(a - b) for a, b in moved_out], default=0.0)))
|
||||
2834
spikes/boolean-weld/results/measures-boolmesh.json
Normal file
117
spikes/boolean-weld/results/table_boolmesh.md
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
| case | kernel | variant | collapses | tris_band | tris_total | slivers_band | min_angle_band | p5_angle_band | flipped_hull_band | dev_mean_pct | dev_max_pct | dev_max_h | ref_to_loop_max_pct | outside_band_moved | crease_verts_removed | split_loop_gap |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| port_flank_s16 | boolmesh | naive | | 157 | 6118 | 32 | 0.00707 | 1.14 | 0 | 0.0117 | 0.0198 | 0.00961 | 0.0233 | 0 | | |
|
||||
| port_flank_s16 | boolmesh | across-literal | 21 | 115 | 6076 | 13 | 0.00707 | 1.81 | 0 | 0.0168 | 0.045 | 0.0218 | 0.0479 | 0 | 0 | |
|
||||
| port_flank_s16 | boolmesh | across-looponly | 12 | 133 | 6094 | 12 | 0.00707 | 2.83 | 0 | 0.0168 | 0.045 | 0.0218 | 0.0479 | 0 | 0 | |
|
||||
| port_flank_s16 | boolmesh | along-literal | 11 | 135 | 6096 | 5 | 5.09 | 6.68 | 0 | 0.0129 | 0.0198 | 0.00961 | 0.0233 | 0 | 0 | |
|
||||
| port_flank_s16 | boolmesh | along-looponly | 10 | 137 | 6098 | 5 | 5.09 | 6.68 | 0 | 0.0129 | 0.0198 | 0.00961 | 0.0233 | 0 | 0 | |
|
||||
| port_flank_s16 | boolmesh | along-looponly-snap | 10 | 137 | 6098 | 5 | 5.09 | 6.68 | 0 | 0.0129 | 0.0198 | 0.00961 | 0.0233 | 0 | 0 | |
|
||||
| port_flank_s16 | boolmesh | across-looponly-snap | 13 | 131 | 6092 | 9 | 0.00707 | 4.09 | 0 | 0.0169 | 0.045 | 0.0218 | 0.0479 | 0 | 0 | |
|
||||
| port_flank_s48 | boolmesh | naive | | 339 | 6300 | 227 | 0.016 | 0.923 | 0 | 0.00148 | 0.00233 | 0.00113 | 0.00475 | 0 | | |
|
||||
| port_flank_s48 | boolmesh | across-literal | 27 | 285 | 6246 | 160 | 0.016 | 1.44 | 0 | 0.00187 | 0.00638 | 0.0031 | 0.00895 | 0 | 0 | |
|
||||
| port_flank_s48 | boolmesh | across-looponly | 19 | 301 | 6262 | 173 | 0.016 | 1.47 | 0 | 0.00187 | 0.00638 | 0.0031 | 0.00895 | 0 | 0 | |
|
||||
| port_flank_s48 | boolmesh | along-literal | 8 | 323 | 6284 | 211 | 0.47 | 1.57 | 0 | 0.00149 | 0.00233 | 0.00113 | 0.00475 | 0 | 0 | |
|
||||
| port_flank_s48 | boolmesh | along-looponly | 8 | 323 | 6284 | 211 | 0.47 | 1.57 | 0 | 0.00149 | 0.00233 | 0.00113 | 0.00475 | 0 | 0 | |
|
||||
| port_flank_s48 | boolmesh | along-looponly-snap | 40 | 259 | 6220 | 119 | 0.934 | 2.25 | 0 | 0.00275 | 0.00547 | 0.00265 | 0.00794 | 0 | 0 | |
|
||||
| port_flank_s48 | boolmesh | across-looponly-snap | 46 | 247 | 6208 | 97 | 1.1 | 2.74 | 0 | 0.00319 | 0.00638 | 0.0031 | 0.00895 | 0 | 0 | |
|
||||
| split_fwd_sub | boolmesh | naive | | 507 | 4404 | 97 | 0.0584 | 1.46 | 0 | 0 | 0 | 0 | 0.0609 | 0 | | |
|
||||
| split_fwd_sub | boolmesh | across-literal | 0 | 507 | 4404 | 97 | 0.0584 | 1.46 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | 0 |
|
||||
| split_fwd_sub | boolmesh | across-looponly | 0 | 507 | 4404 | 97 | 0.0584 | 1.46 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | 0 |
|
||||
| split_fwd_sub | boolmesh | along-literal | 0 | 507 | 4404 | 97 | 0.0584 | 1.46 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | 0 |
|
||||
| split_fwd_sub | boolmesh | along-looponly | 0 | 507 | 4404 | 97 | 0.0584 | 1.46 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | 0 |
|
||||
| split_fwd_sub | boolmesh | along-looponly-snap | 7 | 496 | 4390 | 85 | 0.0584 | 2.07 | 0 | 0.000151 | 0.00867 | 0.00507 | 0.0609 | 0 | 0 | 0.000676 |
|
||||
| split_fwd_sub | boolmesh | across-looponly-snap | 7 | 496 | 4390 | 85 | 0.0584 | 2.07 | 0 | 0.000151 | 0.00867 | 0.00507 | 0.0609 | 0 | 0 | 0.000676 |
|
||||
| split_fwd_sub | boolmesh | naive-split-gap | | | | | | | | | | | | | | 0 |
|
||||
| split_fwd_int | boolmesh | naive | | 445 | 2104 | 92 | 0.0555 | 1.52 | 0 | 0 | 0 | 0 | 0.0609 | 0 | | |
|
||||
| split_fwd_int | boolmesh | across-literal | 0 | 445 | 2104 | 92 | 0.0555 | 1.52 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | |
|
||||
| split_fwd_int | boolmesh | across-looponly | 0 | 445 | 2104 | 92 | 0.0555 | 1.52 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | |
|
||||
| split_fwd_int | boolmesh | along-literal | 0 | 445 | 2104 | 92 | 0.0555 | 1.52 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | |
|
||||
| split_fwd_int | boolmesh | along-looponly | 0 | 445 | 2104 | 92 | 0.0555 | 1.52 | 0 | 0 | 0 | 0 | 0.0609 | 0 | 0 | |
|
||||
| split_fwd_int | boolmesh | along-looponly-snap | 6 | 434 | 2092 | 86 | 0.14 | 2.06 | 0 | 0.000106 | 0.00692 | 0.00405 | 0.0609 | 0 | 0 | |
|
||||
| split_fwd_int | boolmesh | across-looponly-snap | 6 | 434 | 2092 | 86 | 0.14 | 2.06 | 0 | 0.000106 | 0.00692 | 0.00405 | 0.0609 | 0 | 0 | |
|
||||
| probe_equalk_s16 | boolmesh | naive | | 457 | 6164 | 87 | 1.48e-06 | 1.65 | 0 | 0.0186 | 0.0559 | 0.0718 | 0.0575 | 0 | | |
|
||||
| probe_equalk_s16 | boolmesh | across-literal | 34 | 387 | 6096 | 45 | 1.48e-06 | 2.46 | 0 | 0.0203 | 0.0833 | 0.107 | 0.0847 | 0 | 0 | |
|
||||
| probe_equalk_s16 | boolmesh | across-looponly | 31 | 393 | 6102 | 45 | 1.48e-06 | 2.6 | 0 | 0.0203 | 0.0833 | 0.107 | 0.0847 | 0 | 0 | |
|
||||
| probe_equalk_s16 | boolmesh | along-literal | 40 | 355 | 6084 | 38 | 1.71e-06 | 3.61 | 0 | 0.0196 | 0.0546 | 0.0733 | 0.0574 | 0 | 0 | |
|
||||
| probe_equalk_s16 | boolmesh | along-looponly | 38 | 359 | 6088 | 38 | 1.71e-06 | 3.67 | 0 | 0.0196 | 0.0546 | 0.0733 | 0.0574 | 0 | 0 | |
|
||||
| probe_equalk_s16 | boolmesh | along-looponly-snap | 51 | 355 | 6062 | 25 | 1.71e-06 | 5.49 | 0 | 0.019 | 0.0546 | 0.0702 | 0.0574 | 0 | 0 | |
|
||||
| probe_equalk_s16 | boolmesh | across-looponly-snap | 45 | 366 | 6074 | 29 | 1.48e-06 | 4.88 | 0 | 0.0207 | 0.0833 | 0.107 | 0.0847 | 0 | 0 | |
|
||||
| probe_equalk_s48 | boolmesh | naive | | 612 | 6316 | 167 | 0.0118 | 1.05 | 0 | 0.00213 | 0.00638 | 0.0082 | 0.00856 | 0 | | |
|
||||
| probe_equalk_s48 | boolmesh | across-literal | 57 | 498 | 6202 | 73 | 0.0118 | 2.46 | 0 | 0.00248 | 0.0147 | 0.0189 | 0.0165 | 0 | 0 | |
|
||||
| probe_equalk_s48 | boolmesh | across-looponly | 53 | 505 | 6210 | 71 | 0.0118 | 2.47 | 0 | 0.00256 | 0.0191 | 0.0246 | 0.0208 | 0 | 0 | |
|
||||
| probe_equalk_s48 | boolmesh | along-literal | 54 | 504 | 6208 | 75 | 0.157 | 2.98 | 0 | 0.0022 | 0.00638 | 0.0082 | 0.00872 | 0 | 0 | |
|
||||
| probe_equalk_s48 | boolmesh | along-looponly | 53 | 506 | 6210 | 73 | 0.157 | 2.98 | 0 | 0.00222 | 0.00638 | 0.0082 | 0.00872 | 0 | 0 | |
|
||||
| probe_equalk_s48 | boolmesh | along-looponly-snap | 74 | 478 | 6168 | 45 | 0.504 | 4.34 | 0 | 0.00243 | 0.00644 | 0.00795 | 0.00872 | 0 | 0 | |
|
||||
| probe_equalk_s48 | boolmesh | across-looponly-snap | 75 | 468 | 6166 | 42 | 0.92 | 4.2 | 0 | 0.0029 | 0.0191 | 0.0241 | 0.0208 | 0 | 0 | |
|
||||
| probe_saddle_s16 | boolmesh | naive | | 209 | 6144 | 50 | 2.83e-06 | 0.608 | 0 | 0.0132 | 0.0937 | 0.0667 | 0.0949 | 0 | | |
|
||||
| probe_saddle_s16 | boolmesh | across-literal | 32 | 145 | 6080 | 12 | 0.00328 | 2.12 | 1 | 0.0168 | 0.0937 | 0.0667 | 0.0949 | 0 | 0 | |
|
||||
| probe_saddle_s16 | boolmesh | across-looponly | 24 | 161 | 6096 | 12 | 0.00328 | 2.66 | 1 | 0.0168 | 0.0937 | 0.0667 | 0.0949 | 0 | 0 | |
|
||||
| probe_saddle_s16 | boolmesh | along-literal | 24 | 161 | 6096 | 26 | 0.00328 | 0.843 | 1 | 0.0132 | 0.0937 | 0.0667 | 0.0949 | 0 | 0 | |
|
||||
| probe_saddle_s16 | boolmesh | along-looponly | 21 | 167 | 6102 | 25 | 0.00328 | 0.939 | 1 | 0.0132 | 0.0937 | 0.0667 | 0.0949 | 0 | 0 | |
|
||||
| probe_saddle_s16 | boolmesh | along-looponly-snap | 28 | 153 | 6088 | 12 | 1.09 | 2.96 | 1 | 0.0152 | 0.0937 | 0.0667 | 0.0949 | 0 | 0 | |
|
||||
| probe_saddle_s16 | boolmesh | across-looponly-snap | 30 | 149 | 6084 | 7 | 1.16 | 6.78 | 1 | 0.0179 | 0.0937 | 0.0667 | 0.0949 | 0 | 0 | |
|
||||
| probe_saddle_s48 | boolmesh | naive | | 365 | 6300 | 140 | 0.00328 | 0.502 | 0 | 0.0015 | 0.0107 | 0.00764 | 0.0113 | 0 | | |
|
||||
| probe_saddle_s48 | boolmesh | across-literal | 48 | 269 | 6204 | 68 | 0.00328 | 0.85 | 0 | 0.00264 | 0.0246 | 0.0175 | 0.0286 | 0 | 0 | |
|
||||
| probe_saddle_s48 | boolmesh | across-looponly | 42 | 281 | 6216 | 68 | 0.00328 | 0.857 | 0 | 0.00264 | 0.0246 | 0.0175 | 0.0286 | 0 | 0 | |
|
||||
| probe_saddle_s48 | boolmesh | along-literal | 29 | 307 | 6242 | 83 | 0.00328 | 0.845 | 0 | 0.00184 | 0.0123 | 0.00876 | 0.0133 | 0 | 0 | |
|
||||
| probe_saddle_s48 | boolmesh | along-looponly | 28 | 309 | 6244 | 83 | 0.00328 | 0.846 | 0 | 0.00184 | 0.0123 | 0.00876 | 0.0133 | 0 | 0 | |
|
||||
| probe_saddle_s48 | boolmesh | along-looponly-snap | 60 | 245 | 6180 | 41 | 0.0435 | 2.26 | 0 | 0.00275 | 0.0237 | 0.0169 | 0.0251 | 0 | 0 | |
|
||||
| probe_saddle_s48 | boolmesh | across-looponly-snap | 72 | 221 | 6156 | 27 | 0.0435 | 3.03 | 0 | 0.00403 | 0.0246 | 0.0175 | 0.0286 | 0 | 0 | |
|
||||
| probe_crease_sub | boolmesh | naive | | 342 | 5890 | 44 | 0.0326 | 2.41 | 0 | 0 | 0 | 0 | 0.0437 | 0 | | |
|
||||
| probe_crease_sub | boolmesh | across-literal | 0 | 342 | 5890 | 44 | 0.0326 | 2.41 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | 0 |
|
||||
| probe_crease_sub | boolmesh | across-looponly | 0 | 342 | 5890 | 44 | 0.0326 | 2.41 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | 0 |
|
||||
| probe_crease_sub | boolmesh | along-literal | 0 | 342 | 5890 | 44 | 0.0326 | 2.41 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | 0 |
|
||||
| probe_crease_sub | boolmesh | along-looponly | 0 | 342 | 5890 | 44 | 0.0326 | 2.41 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | 0 |
|
||||
| probe_crease_sub | boolmesh | along-looponly-snap | 5 | 332 | 5880 | 33 | 0.292 | 3.34 | 0 | 6.39e-05 | 0.00404 | 0.00202 | 0.0437 | 0 | 0 | 1.46e-05 |
|
||||
| probe_crease_sub | boolmesh | across-looponly-snap | 5 | 332 | 5880 | 33 | 0.292 | 3.34 | 0 | 6.39e-05 | 0.00404 | 0.00202 | 0.0437 | 0 | 0 | 1.46e-05 |
|
||||
| probe_crease_sub | boolmesh | naive-split-gap | | | | | | | | | | | | | | 0 |
|
||||
| probe_crease_int | boolmesh | naive | | 319 | 458 | 47 | 0.0326 | 2.7 | 0 | 0 | 0 | 0 | 0.0437 | 0 | | |
|
||||
| probe_crease_int | boolmesh | across-literal | 0 | 319 | 458 | 47 | 0.0326 | 2.7 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | |
|
||||
| probe_crease_int | boolmesh | across-looponly | 0 | 319 | 458 | 47 | 0.0326 | 2.7 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | |
|
||||
| probe_crease_int | boolmesh | along-literal | 0 | 319 | 458 | 47 | 0.0326 | 2.7 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | |
|
||||
| probe_crease_int | boolmesh | along-looponly | 0 | 319 | 458 | 47 | 0.0326 | 2.7 | 0 | 0 | 0 | 0 | 0.0437 | 0 | 0 | |
|
||||
| probe_crease_int | boolmesh | along-looponly-snap | 5 | 310 | 448 | 40 | 0.0326 | 3.95 | 0 | 7.23e-05 | 0.00404 | 0.00202 | 0.0437 | 0 | 0 | |
|
||||
| probe_crease_int | boolmesh | across-looponly-snap | 5 | 310 | 448 | 40 | 0.0326 | 3.95 | 0 | 7.23e-05 | 0.00404 | 0.00202 | 0.0437 | 0 | 0 | |
|
||||
| probe_switch_s48 | boolmesh | naive | | 488 | 6238 | 112 | 1.21e-06 | 0.624 | 0 | 0.00582 | 0.0128 | 0.00624 | 0.0261 | 0 | | |
|
||||
| probe_switch_s48 | boolmesh | across-literal | 52 | 384 | 6134 | 57 | 0.0592 | 2.19 | 0 | 0.00637 | 0.022 | 0.0107 | 0.0673 | 0 | 0 | |
|
||||
| probe_switch_s48 | boolmesh | across-looponly | 47 | 394 | 6144 | 60 | 0.0592 | 2.15 | 0 | 0.0064 | 0.022 | 0.0107 | 0.0673 | 0 | 0 | |
|
||||
| probe_switch_s48 | boolmesh | along-literal | 52 | 384 | 6134 | 56 | 1.21e-06 | 2.07 | 0 | 0.00582 | 0.0196 | 0.00951 | 0.0309 | 0 | 0 | |
|
||||
| probe_switch_s48 | boolmesh | along-looponly | 48 | 392 | 6142 | 57 | 1.21e-06 | 2.12 | 0 | 0.00587 | 0.0196 | 0.00951 | 0.0309 | 0 | 0 | |
|
||||
| probe_switch_s48 | boolmesh | along-looponly-snap | 62 | 364 | 6114 | 43 | 1.21e-06 | 3.62 | 0 | 0.00619 | 0.0196 | 0.00948 | 0.0309 | 0 | 0 | |
|
||||
| probe_switch_s48 | boolmesh | across-looponly-snap | 61 | 381 | 6116 | 49 | 0.0592 | 3.45 | 0 | 0.00659 | 0.022 | 0.0102 | 0.0673 | 0 | 0 | |
|
||||
|
||||
| case/kernel/mode | hull-owned | cutter-owned | switches | near-tie | crease loop verts | median abs k_hull | median abs k_cutter | origins |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| port_flank_s16|boolmesh|across | 34 | 2 | 4 | 0 | 0 | 1.06 | 0.0515 | {'H': 10, 'C': 26, 'HC': 0, 'X': 0} |
|
||||
| port_flank_s16|boolmesh|along | 0 | 36 | 0 | 0 | 0 | 1.09 | 66.6 | {'H': 10, 'C': 26, 'HC': 0, 'X': 0} |
|
||||
| port_flank_s16|boolmesh|mean | 0 | 36 | 0 | 0 | 0 | 0.35 | 33.3 | {'H': 10, 'C': 26, 'HC': 0, 'X': 0} |
|
||||
| port_flank_s48|boolmesh|across | 93 | 2 | 4 | 0 | 0 | 1.06 | 0.0459 | {'H': 10, 'C': 85, 'HC': 0, 'X': 0} |
|
||||
| port_flank_s48|boolmesh|along | 0 | 95 | 0 | 0 | 0 | 1.08 | 66.6 | {'H': 10, 'C': 85, 'HC': 0, 'X': 0} |
|
||||
| port_flank_s48|boolmesh|mean | 0 | 95 | 0 | 0 | 0 | 0.342 | 33.3 | {'H': 10, 'C': 85, 'HC': 0, 'X': 0} |
|
||||
| split_fwd_sub|boolmesh|across | 124 | 0 | 0 | 0 | 2 | 1.59 | 0 | {'H': 124, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| split_fwd_sub|boolmesh|along | 124 | 0 | 0 | 0 | 2 | 0.844 | 0 | {'H': 124, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| split_fwd_sub|boolmesh|mean | 124 | 0 | 0 | 0 | 2 | 0.687 | 0 | {'H': 124, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| split_fwd_int|boolmesh|across | 124 | 0 | 0 | 0 | 2 | 1.59 | 0 | {'H': 124, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| split_fwd_int|boolmesh|along | 124 | 0 | 0 | 0 | 2 | 0.844 | 0 | {'H': 124, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| split_fwd_int|boolmesh|mean | 124 | 0 | 0 | 0 | 2 | 0.687 | 0 | {'H': 124, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| probe_equalk_s16|boolmesh|across | 50 | 41 | 10 | 4 | 0 | 5.69 | 3.07 | {'H': 66, 'C': 25, 'HC': 0, 'X': 0} |
|
||||
| probe_equalk_s16|boolmesh|along | 21 | 70 | 8 | 11 | 0 | 19.8 | 47.1 | {'H': 66, 'C': 25, 'HC': 0, 'X': 0} |
|
||||
| probe_equalk_s16|boolmesh|mean | 16 | 75 | 2 | 3 | 0 | 13 | 25.1 | {'H': 66, 'C': 25, 'HC': 0, 'X': 0} |
|
||||
| probe_equalk_s48|boolmesh|across | 82 | 54 | 10 | 3 | 0 | 5.24 | 2.87 | {'H': 66, 'C': 70, 'HC': 0, 'X': 0} |
|
||||
| probe_equalk_s48|boolmesh|along | 24 | 112 | 6 | 15 | 0 | 16.3 | 47.3 | {'H': 66, 'C': 70, 'HC': 0, 'X': 0} |
|
||||
| probe_equalk_s48|boolmesh|mean | 21 | 115 | 2 | 4 | 0 | 11.1 | 25.1 | {'H': 66, 'C': 70, 'HC': 0, 'X': 0} |
|
||||
| probe_saddle_s16|boolmesh|across | 36 | 21 | 18 | 2 | 2 | 10.6 | 8.12 | {'H': 29, 'C': 26, 'HC': 2, 'X': 0} |
|
||||
| probe_saddle_s16|boolmesh|along | 9 | 48 | 14 | 8 | 2 | 31.6 | 58.5 | {'H': 29, 'C': 26, 'HC': 2, 'X': 0} |
|
||||
| probe_saddle_s16|boolmesh|mean | 13 | 44 | 10 | 10 | 2 | 21.1 | 33.3 | {'H': 29, 'C': 26, 'HC': 2, 'X': 0} |
|
||||
| probe_saddle_s48|boolmesh|across | 64 | 42 | 18 | 7 | 2 | 12.3 | 8.95 | {'H': 29, 'C': 75, 'HC': 2, 'X': 0} |
|
||||
| probe_saddle_s48|boolmesh|along | 18 | 88 | 12 | 14 | 2 | 29.1 | 57.7 | {'H': 29, 'C': 75, 'HC': 2, 'X': 0} |
|
||||
| probe_saddle_s48|boolmesh|mean | 17 | 89 | 10 | 19 | 2 | 19.9 | 33.3 | {'H': 29, 'C': 75, 'HC': 2, 'X': 0} |
|
||||
| probe_crease_sub|boolmesh|across | 84 | 0 | 0 | 0 | 2 | 0.708 | 0 | {'H': 84, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| probe_crease_sub|boolmesh|along | 84 | 0 | 0 | 0 | 2 | 1.52 | 0 | {'H': 84, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| probe_crease_sub|boolmesh|mean | 84 | 0 | 0 | 0 | 2 | 1.09 | 0 | {'H': 84, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| probe_crease_int|boolmesh|across | 84 | 0 | 0 | 0 | 2 | 0.708 | 0 | {'H': 84, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| probe_crease_int|boolmesh|along | 84 | 0 | 0 | 0 | 2 | 1.52 | 0 | {'H': 84, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| probe_crease_int|boolmesh|mean | 84 | 0 | 0 | 0 | 2 | 1.09 | 0 | {'H': 84, 'C': 0, 'HC': 0, 'X': 0} |
|
||||
| probe_switch_s48|boolmesh|across | 79 | 53 | 12 | 7 | 0 | 0.755 | 0.527 | {'H': 62, 'C': 70, 'HC': 0, 'X': 0} |
|
||||
| probe_switch_s48|boolmesh|along | 24 | 108 | 4 | 9 | 0 | 1.07 | 12 | {'H': 62, 'C': 70, 'HC': 0, 'X': 0} |
|
||||
| probe_switch_s48|boolmesh|mean | 22 | 110 | 4 | 11 | 0 | 1.14 | 6.25 | {'H': 62, 'C': 70, 'HC': 0, 'X': 0} |
|
||||