Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Compare mesh operations with Blender, and fix bevel

Nguyen Xuan Anb58f50d26ef6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4c42a254..3124ebf6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog
+## Unreleased
+
+- Change the bevel `profile` to the meaning it has in Blender: 0.5 is a circular arc, 0.25 is flat, 1 is square, and below 0.25 is concave. Before this, 0 was flat and 0.5 was a parabola, so a recipe with a `profile` other than 0.5 changes shape
+- Stop adding a fan of triangles where one beveled edge ends at a vertex with three faces. The third face now takes the profile's points, as in Blender
+
## 0.14.0
- Add `motion.ik` to imported assets: IK runs over the selected clip and overrides, moves every skin and rigid part, and takes `worldForward`, so agents can pose imported characters through MCP without writing quaternions
diff --git a/docs/mesh.md b/docs/mesh.md
index 5de11e80..b5165c35 100644
--- a/docs/mesh.md
+++ b/docs/mesh.md
@@ -214,16 +214,17 @@ as Blender's Apply modifier, which leaves the result unchanged.
| `edges` | `{ "between": [faceRule, faceRule] }` (the rim between two regions, for example top and side), `{ "angle": 30 }` (edges bending at least this many degrees; the default), `{ "boundaryOf": faceRule }`, or `{ "all": true }` |
| `width` | Distance from the edge into each neighbouring face |
| `segments` | 1 to 16; 1 is a flat chamfer, 3 or more reads as round |
-| `profile` | 0 flat, 0.5 round (default), 1 boxy |
+| `profile` | As in Blender: 0.5 is a circular arc (default), 0.25 is flat, 1 is square, and below 0.25 is concave |
| `clampOverlap` | Default true: shrink `width` so neighbouring bevels cannot cross; the result reports `clamped` and the `width` used |
Only edges with two consistently wound faces bevel. A face corner next to one beveled edge slides along its other
edge, shared with the face across that edge, so no T-junctions appear. Each beveled edge becomes a strip of
-`segments` quads following a quadratic profile around the original edge (tag `<name>.strip`). Where beveled edges meet
-at a vertex, the gap is filled (tag `<name>.corner`): a corner where three rounded edges meet gets a quadratic
-triangular patch that matches the three profiles exactly; other corners get a flat polygon (chamfers) or a fan to a
-raised centre. The quadratic profile is close to, not exactly, a circular arc, so rounded corners shade slightly
-differently from Blender's. Edges between strip segments render smooth when the bend per segment is under the mesh's
+`segments` quads following a superellipse around the original edge (tag `<name>.strip`). At a vertex with one beveled
+edge and three faces, the third face takes the profile's points and no fill is needed. Where beveled edges meet at a
+vertex, the gap is filled (tag `<name>.corner`): a corner where three rounded edges meet gets a quadratic
+triangular patch that shares the three profiles on its border; other corners get a flat polygon (chamfers) or a fan to
+a raised centre. `tests/fixtures/blender/differences.json` lists where the result differs from Blender, including
+these corners. Edges between strip segments render smooth when the bend per segment is under the mesh's
`smoothAngle`; with 2 segments on a right angle (45 degrees each), raise `smoothAngle` or use 3 or more segments.
### Loop cut
diff --git a/docs/parity.md b/docs/parity.md
index 35c7200f..1736db1a 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -14,7 +14,9 @@ It is the record for the goal in issue #23. Use `npm run parity` to print the co
Agents are the user of 67.js, so a row judges the purpose of a Blender feature and not its interface. A row covers the pages below it unless a finer row exists.
-`done` does not mean equal to Blender. A test shows that the feature works, and it does not show that the result matches. `npm run parity` counts a row as compared only when its evidence is in `tests/fixtures/blender/` or `bench/reference/`. That count is 0 until issues #25 and #26 land.
+`done` does not mean equal to Blender. A test shows that the feature works, and it does not show that the result matches. `npm run parity` counts a row as compared only when its evidence is in `tests/fixtures/blender/` or `bench/reference/`. Issue #26 adds the render comparison.
+
+`tests/blender-golden.test.js` compares mesh operations with results from Blender. A compared row can still differ, and `tests/fixtures/blender/differences.json` gives the reason for each difference.
Rows differ in size: `Modeling > Modifiers > Generate > Weld Modifier` and `Rendering > Render Engines > Cycles` each count as one. Do not quote the percentage as a measure of how close 67.js is to Blender.
@@ -40,7 +42,7 @@ To move to a new Blender release, run `node scripts/parity-manual-snapshot.mjs`.
| Modeling > Meshes > Primitives | partial | Box, cylinder, sphere and torus. There is no plane, grid, cone, ico sphere or monkey primitive. | | |
| Modeling > Meshes > Tools | partial | The operations behind extrude and loop cut exist as edits. Spin is covered only by `lathe`. | | #41 |
| Modeling > Meshes > Selecting | partial | Rules: all, tag, normal, inside, faces, and, or, not, grow, boundary. There is no loop, linked, similar or sharp edge selection. | | #41 |
-| Modeling > Meshes > Editing | partial | 16 edits, including extrude, inset, bevel, loop cut, boolean and merge. There is no bisect, knife, bridge, fill or dissolve. | | #41 |
+| Modeling > Meshes > Editing | partial | 16 edits, including extrude, inset, bevel, loop cut, boolean and merge. There is no bisect, knife, bridge, fill or dissolve. | [Blender results](../tests/fixtures/blender/golden.json) | #41 |
| Modeling > Meshes > Properties | partial | `smoothAngle` and face tags. There is no sharp edge attribute or crease. | | #39 |
| Modeling > Meshes > UVs | partial | `uv_unwrap` with LSCM, axis charts and shelf packing. Patterns can not use the result yet. | | #50 |
| Modeling > Meshes > Mesh Analysis | partial | `lintMesh` reports topology problems. There is no check for thin walls or intersections. | | #66 |
@@ -62,23 +64,23 @@ To move to a new Blender release, run `node scripts/parity-manual-snapshot.mjs`.
| Modeling > Modifiers > Edit > Vertex Weight Edit Modifier | missing | No vertex groups in recipes. | | #46 |
| Modeling > Modifiers > Edit > Vertex Weight Mix Modifier | missing | No vertex groups in recipes. | | #46 |
| Modeling > Modifiers > Edit > Vertex Weight Proximity Modifier | missing | No vertex groups in recipes. | | #46 |
-| Modeling > Modifiers > Generate > Array Modifier | done | Stack node with count, offset, relative offset and merge. | [mesh-stack](../tests/mesh-stack.test.js) | |
+| Modeling > Modifiers > Generate > Array Modifier | done | Stack node with count, offset, relative offset and merge. | [mesh-stack](../tests/mesh-stack.test.js), [Blender results](../tests/fixtures/blender/golden.json) | |
| Modeling > Modifiers > Generate > Array (Legacy) Modifier | out of scope | The Array Modifier row replaces it. | | |
-| Modeling > Modifiers > Generate > Bevel Modifier | done | Stack node and edit, with segments, profile and overlap clamp, on edges only. | [mesh-bevel](../tests/mesh-bevel.test.js) | |
-| Modeling > Modifiers > Generate > Boolean Modifier | partial | Manifold boolean as an edit. It is not a stack node. | [mesh-boolean](../tests/mesh-boolean.test.js) | |
+| Modeling > Modifiers > Generate > Bevel Modifier | done | Stack node and edit, with segments, profile and overlap clamp, on edges only. | [mesh-bevel](../tests/mesh-bevel.test.js), [Blender results](../tests/fixtures/blender/golden.json) | |
+| Modeling > Modifiers > Generate > Boolean Modifier | partial | Manifold boolean as an edit. It is not a stack node. | [mesh-boolean](../tests/mesh-boolean.test.js), [Blender results](../tests/fixtures/blender/golden.json) | |
| Modeling > Modifiers > Generate > Build Modifier | missing | No equivalent. | | |
| Modeling > Modifiers > Generate > Curve to Tube Modifier | partial | `tube` is a geometry type. It is not a stack node. | [modeling](../tests/modeling.test.js) | #45 |
| Modeling > Modifiers > Generate > Decimate Modifier | missing | No decimation. | | #40 |
| Modeling > Modifiers > Generate > Edge Split Modifier | missing | No equivalent. `smoothAngle` splits normals by angle. | | #42 |
| Modeling > Modifiers > Generate > Mask Modifier | missing | No equivalent. | | |
| Modeling > Modifiers > Generate > Mesh to Volume Modifier | missing | No volume objects. | | |
-| Modeling > Modifiers > Generate > Mirror Modifier | done | Stack node with axis and merge. | [mesh-stack](../tests/mesh-stack.test.js) | |
+| Modeling > Modifiers > Generate > Mirror Modifier | done | Stack node with axis and merge. | [mesh-stack](../tests/mesh-stack.test.js), [Blender results](../tests/fixtures/blender/golden.json) | |
| Modeling > Modifiers > Generate > Multiresolution Modifier | missing | No multiresolution. | | |
| Modeling > Modifiers > Generate > Remesh Modifier | missing | No remesh. | | #40 |
| Modeling > Modifiers > Generate > Scatter on Surface Modifier | partial | `addons/clutter` and `addons/grass` scatter in code. Recipes have no scatter node. | | #42 |
| Modeling > Modifiers > Generate > Screw Modifier | partial | `lathe` covers a full turn. There is no stack node or screw offset. | | #42 |
| Modeling > Modifiers > Generate > Skin Modifier | missing | No equivalent. | | #42 |
-| Modeling > Modifiers > Generate > Solidify Modifier | done | Stack node with thickness, offset and even thickness. | [mesh-stack](../tests/mesh-stack.test.js) | |
+| Modeling > Modifiers > Generate > Solidify Modifier | done | Stack node with thickness, offset and even thickness. | [mesh-stack](../tests/mesh-stack.test.js), [Blender results](../tests/fixtures/blender/golden.json) | |
| Modeling > Modifiers > Generate > Subdivision Surface Modifier | missing | No subdivision. | | #39 |
| Modeling > Modifiers > Generate > Triangulate Modifier | missing | Render data is triangulated. There is no node that changes the mesh. | | #42 |
| Modeling > Modifiers > Generate > Volume to Mesh Modifier | missing | No volume objects. | | |
diff --git a/scripts/blender-golden.py b/scripts/blender-golden.py
new file mode 100644
index 00000000..b62c7044
--- /dev/null
+++ b/scripts/blender-golden.py
@@ -0,0 +1,297 @@
+# Runs each case in tests/fixtures/blender/cases.json in Blender and writes the results to golden.json beside it.
+# Run it when a case changes or Blender moves to a new release:
+# blender -b --factory-startup --python scripts/blender-golden.py
+import json
+from math import cos, radians, sqrt
+from pathlib import Path
+
+import bmesh
+import bpy
+from mathutils import Vector
+
+FIXTURE_DIRECTORY = Path(__file__).resolve().parent.parent / "tests" / "fixtures" / "blender"
+DEFAULT_MAX_ANGLE = 10
+ANGLE_EPSILON = 1e-9
+
+
+def new_bmesh(mesh_input):
+ bm = bmesh.new()
+ vertices = [bm.verts.new(position) for position in mesh_input["vertices"]]
+ for face in mesh_input["faces"]:
+ bm.faces.new([vertices[index] for index in face])
+ refresh(bm)
+ return bm
+
+
+def refresh(bm):
+ bm.verts.ensure_lookup_table()
+ bm.edges.ensure_lookup_table()
+ bm.faces.ensure_lookup_table()
+ bm.normal_update()
+
+
+def new_object(name, mesh_input):
+ mesh = bpy.data.meshes.new(name)
+ mesh.from_pydata(mesh_input["vertices"], [], mesh_input["faces"])
+ mesh.update()
+ mesh_object = bpy.data.objects.new(name, mesh)
+ bpy.context.scene.collection.objects.link(mesh_object)
+ return mesh_object
+
+
+def selected_faces(bm, rule):
+ if "faces" in rule:
+ return [bm.faces[index] for index in rule["faces"]]
+ if "normal" in rule:
+ direction = Vector(rule["normal"]).normalized()
+ limit = cos(radians(rule.get("maxAngle", DEFAULT_MAX_ANGLE))) - ANGLE_EPSILON
+ return [face for face in bm.faces if face.normal.dot(direction) >= limit]
+ raise ValueError(f"Unsupported face rule: {rule}")
+
+
+def selected_edges(bm, rule):
+ if rule.get("all"):
+ return [edge for edge in bm.edges if len(edge.link_faces) == 2]
+ if "along" in rule:
+ direction = Vector(rule["along"]).normalized()
+ limit = cos(radians(rule.get("maxAngle", DEFAULT_MAX_ANGLE))) - ANGLE_EPSILON
+ return [edge for edge in bm.edges if edge_is_along(edge, direction, limit)]
+ if "boundaryOf" in rule:
+ inside = set(selected_faces(bm, rule["boundaryOf"]))
+ return [edge for edge in bm.edges if edge_crosses(edge, inside)]
+ if "between" in rule:
+ first = set(selected_faces(bm, rule["between"][0]))
+ second = set(selected_faces(bm, rule["between"][1]))
+ return [edge for edge in bm.edges if edge_joins(edge, first, second)]
+ raise ValueError(f"Unsupported edge rule: {rule}")
+
+
+def edge_is_along(edge, direction, limit):
+ vector = (edge.verts[1].co - edge.verts[0].co).normalized()
+ return abs(vector.dot(direction)) >= limit
+
+
+def edge_crosses(edge, inside):
+ faces = edge.link_faces
+ return len(faces) == 2 and (faces[0] in inside) != (faces[1] in inside)
+
+
+def edge_joins(edge, first, second):
+ faces = edge.link_faces
+ if len(faces) != 2:
+ return False
+ return (faces[0] in first and faces[1] in second) or (faces[1] in first and faces[0] in second)
+
+
+def area_weighted_normal(faces):
+ total = Vector((0, 0, 0))
+ for face in faces:
+ total += face.normal * face.calc_area()
+ return total.normalized()
+
+
+def move(bm, vertices, offset):
+ bmesh.ops.translate(bm, verts=list(vertices), vec=offset)
+
+
+def extrude_face_region(bm, edit):
+ faces = selected_faces(bm, edit["select"])
+ normal = area_weighted_normal(faces)
+ result = bmesh.ops.extrude_face_region(bm, geom=faces)
+ new_vertices = [element for element in result["geom"] if isinstance(element, bmesh.types.BMVert)]
+ move(bm, new_vertices, normal * edit["offset"])
+ # Blender keeps the source faces when the extrusion is not a closed region. The operator in the editor removes them.
+ bmesh.ops.delete(bm, geom=faces, context="FACES")
+
+
+def extrude_individual(bm, edit):
+ faces = selected_faces(bm, edit["select"])
+ normals = [face.normal.copy() for face in faces]
+ result = bmesh.ops.extrude_discrete_faces(bm, faces=faces)
+ for face, normal in zip(result["faces"], normals):
+ move(bm, face.verts, normal * edit["offset"])
+
+
+def inset_region(bm, edit):
+ faces = selected_faces(bm, edit["select"])
+ # The editor's Inset Faces turns use_boundary on, and the operator's own default is off.
+ bmesh.ops.inset_region(
+ bm,
+ faces=faces,
+ thickness=edit["thickness"],
+ depth=edit.get("depth", 0),
+ use_even_offset=True,
+ use_boundary=True,
+ )
+
+
+def inset_individual(bm, edit):
+ faces = selected_faces(bm, edit["select"])
+ bmesh.ops.inset_individual(bm, faces=faces, thickness=edit["thickness"], depth=edit.get("depth", 0), use_even_offset=True)
+
+
+def bevel(bm, edit):
+ edges = selected_edges(bm, edit["edges"])
+ vertices = {vertex for edge in edges for vertex in edge.verts}
+ bmesh.ops.bevel(
+ bm,
+ geom=edges + list(vertices),
+ offset=edit["width"],
+ offset_type="OFFSET",
+ profile_type="SUPERELLIPSE",
+ segments=edit.get("segments", 1),
+ profile=edit.get("profile", 0.5),
+ affect="EDGES",
+ clamp_overlap=edit.get("clampOverlap", True),
+ loop_slide=True,
+ )
+
+
+def low_vertex_first(edge):
+ first, second = edge.verts
+ return tuple(first.co) <= tuple(second.co)
+
+
+def loop_cut(bm, edit):
+ edges = selected_edges(bm, edit["edges"])
+ cuts = edit.get("cuts", 1)
+ factor = edit.get("factor", 0.5)
+ edge_percents = {}
+ if cuts == 1 and factor != 0.5:
+ edge_percents = {edge: factor if low_vertex_first(edge) else 1 - factor for edge in edges}
+ bmesh.ops.subdivide_edges(bm, edges=edges, cuts=cuts, use_grid_fill=True, edge_percents=edge_percents)
+
+
+BMESH_OPERATIONS = {
+ "extrude_face_region": extrude_face_region,
+ "extrude_individual": extrude_individual,
+ "inset_region": inset_region,
+ "inset_individual": inset_individual,
+ "bevel": bevel,
+ "loop_cut": loop_cut,
+}
+
+
+def add_mirror(mesh_object, edit, _inputs):
+ modifier = mesh_object.modifiers.new("Mirror", "MIRROR")
+ axis = "xyz".index(edit.get("axis", "x"))
+ modifier.use_axis = [index == axis for index in range(3)]
+ modifier.use_mirror_merge = True
+ modifier.merge_threshold = edit.get("merge", 0.001)
+
+
+def add_array(mesh_object, edit, _inputs):
+ modifier = mesh_object.modifiers.new("Array", "ARRAY")
+ modifier.fit_type = "FIXED_COUNT"
+ modifier.count = edit.get("count", 2)
+ modifier.use_relative_offset = True
+ modifier.relative_offset_displace = edit.get("relativeOffset", [1, 0, 0])
+ modifier.use_constant_offset = True
+ modifier.constant_offset_displace = edit.get("offset", [0, 0, 0])
+ merge = edit.get("merge", 0)
+ modifier.use_merge_vertices = merge > 0
+ modifier.merge_threshold = merge
+
+
+def add_solidify(mesh_object, edit, _inputs):
+ modifier = mesh_object.modifiers.new("Solidify", "SOLIDIFY")
+ modifier.solidify_mode = "EXTRUDE"
+ modifier.thickness = edit["thickness"]
+ modifier.offset = edit.get("offset", -1)
+ modifier.use_even_offset = edit.get("evenThickness", True)
+ modifier.use_rim = True
+
+
+def add_boolean(mesh_object, edit, inputs):
+ cutter = new_object("Cutter", inputs[edit["cutter"]["type"]])
+ cutter.location = edit.get("translation", [0, 0, 0])
+ cutter.scale = edit.get("scale", [1, 1, 1])
+ cutter.hide_render = True
+ modifier = mesh_object.modifiers.new("Boolean", "BOOLEAN")
+ modifier.operation = edit["operation"].upper()
+ modifier.solver = "MANIFOLD"
+ modifier.object = cutter
+
+
+MODIFIERS = {
+ "mirror": add_mirror,
+ "array": add_array,
+ "solidify": add_solidify,
+ "boolean": add_boolean,
+}
+
+
+def run_bmesh_case(case, inputs):
+ bm = new_bmesh(inputs[case["input"]])
+ BMESH_OPERATIONS[case["edit"]["op"]](bm, case["edit"])
+ refresh(bm)
+ return bm
+
+
+def run_modifier_case(case, inputs):
+ mesh_object = new_object("Input", inputs[case["input"]])
+ MODIFIERS[case["edit"]["op"]](mesh_object, case["edit"], inputs)
+ bpy.context.view_layer.update()
+ evaluated = mesh_object.evaluated_get(bpy.context.evaluated_depsgraph_get())
+ bm = bmesh.new()
+ bm.from_mesh(evaluated.to_mesh())
+ refresh(bm)
+ evaluated.to_mesh_clear()
+ return bm
+
+
+def fan_triangles(face):
+ corners = [vertex.co for vertex in face.verts]
+ for index in range(1, len(corners) - 1):
+ yield corners[0], corners[index], corners[index + 1]
+
+
+def measure(bm):
+ volume = 0.0
+ area = 0.0
+ for face in bm.faces:
+ # Summing signed triangles keeps both measures right on a concave face.
+ vector_area = Vector((0, 0, 0))
+ for first, second, third in fan_triangles(face):
+ volume += first.dot(second.cross(third)) / 6
+ vector_area += (second - first).cross(third - first) / 2
+ area += vector_area.length
+ positions = [list(vertex.co) for vertex in bm.verts]
+ face_sizes = {}
+ for face in bm.faces:
+ size = str(len(face.verts))
+ face_sizes[size] = face_sizes.get(size, 0) + 1
+ return {
+ "vertexCount": len(bm.verts),
+ "edgeCount": len(bm.edges),
+ "faceCount": len(bm.faces),
+ "faceSizes": dict(sorted(face_sizes.items(), key=lambda entry: int(entry[0]))),
+ "volume": round(abs(volume), 6),
+ "area": round(area, 6),
+ "positions": sorted([round(value, 5) for value in position] for position in positions),
+ }
+
+
+def remove_all_objects():
+ for mesh_object in list(bpy.data.objects):
+ bpy.data.objects.remove(mesh_object)
+ for mesh in list(bpy.data.meshes):
+ bpy.data.meshes.remove(mesh)
+
+
+def main():
+ fixture = json.loads((FIXTURE_DIRECTORY / "cases.json").read_text(encoding="utf-8"))
+ results = {}
+ for case in fixture["cases"]:
+ remove_all_objects()
+ operation = case["edit"]["op"]
+ runner = run_bmesh_case if operation in BMESH_OPERATIONS else run_modifier_case
+ bm = runner(case, fixture["inputs"])
+ results[case["id"]] = measure(bm)
+ bm.free()
+ output = {"blenderVersion": bpy.app.version_string, "results": results}
+ (FIXTURE_DIRECTORY / "golden.json").write_text(json.dumps(output, indent=1) + "\n", encoding="utf-8")
+ print(f"Wrote {len(results)} results from Blender {bpy.app.version_string}.")
+
+
+main()
diff --git a/src/mesh-bevel.js b/src/mesh-bevel.js
index b9a0352e..e428e767 100644
--- a/src/mesh-bevel.js
+++ b/src/mesh-bevel.js
@@ -111,9 +111,19 @@ const normalize = vector => {
return size === 0 ? [0, 0, 0] : scale(vector, 1 / size);
};
+// The superellipse x^r + y^r = 1 between the two slide points, with the same meaning of profile as Blender. Returns how
+// far a point sits toward each slide point from the corner, for t from 0 to 1 along the curve.
+const MINIMUM_PROFILE = 0.001;
+function profileWeights(profile, t) {
+ const exponent = -2 * Math.log(Math.sqrt(Math.max(profile, MINIMUM_PROFILE))) / Math.LN2;
+ const angle = t * Math.PI / 2;
+ return [1 - Math.sin(angle) ** exponent, 1 - Math.cos(angle) ** exponent];
+}
+
/**
* Bevel the selected edges. Options: width (distance from the edge into each face), segments (1 is a flat chamfer),
- * profile (0 flat, 0.5 round, 1 boxy), clampOverlap (shrink width so slides stay within half of their edge).
+ * profile (0.5 round, 0.25 flat, 1 square, below 0.25 concave), clampOverlap (shrink width so slides stay within half
+ * of their edge).
* Returns { mesh, width, clamped, bevelEdges, stripFaces, cornerFaces, filledCorners }. Strip faces get `<name>.strip`,
* corner fills `<name>.corner`; the faces around keep their tags.
*/
@@ -235,15 +245,13 @@ export function bevelEdges(mesh, edgeRule, { width, segments = 1, profile = 0.5,
if (!points) {
const low = Math.min(from, to);
const high = Math.max(from, to);
- const start = positionOfPoint(low);
- const end = positionOfPoint(high);
- const middle = scale(add(start, end), 0.5);
- const control = add(middle, scale(subtract(positionOf(vertex), middle), 2 * profile));
+ const corner = positionOf(vertex);
+ const towardStart = subtract(positionOfPoint(low), corner);
+ const towardEnd = subtract(positionOfPoint(high), corner);
points = [low];
for (let step = 1; step < segments; step++) {
- const t = step / segments;
- const position = add(add(scale(start, (1 - t) ** 2), scale(control, 2 * t * (1 - t))), scale(end, t * t));
- points.push(addPoint(position));
+ const [startWeight, endWeight] = profileWeights(profile, step / segments);
+ points.push(addPoint(add(add(corner, scale(towardStart, startWeight)), scale(towardEnd, endWeight))));
}
points.push(high);
curves.set(key, points);
@@ -251,11 +259,30 @@ export function bevelEdges(mesh, edgeRule, { width, segments = 1, profile = 0.5,
return from === points[0] ? points : [...points].reverse();
};
+ // A quadratic Bezier control whose curve passes through the middle of the profile, for the patch inside a corner.
const curveControl = (vertex, from, to) => {
- const middle = scale(add(positionOfPoint(from), positionOfPoint(to)), 0.5);
- return add(middle, scale(subtract(positionOf(vertex), middle), 2 * profile));
+ const corner = positionOf(vertex);
+ const towardBoth = add(subtract(positionOfPoint(from), corner), subtract(positionOfPoint(to), corner));
+ return add(corner, scale(towardBoth, 1.5 - 2 * Math.sqrt(profile)));
};
+ // A vertex with one beveled edge and three faces needs no fill: the profile lies in the third face, so that face
+ // takes the curve's points, and the two slide points stay on its boundary.
+ const endsInThirdFace = new Set();
+ const cornersOfVertex = new Map();
+ for (const corner of corners) {
+ if (!cornersOfVertex.has(corner.vertex)) cornersOfVertex.set(corner.vertex, []);
+ cornersOfVertex.get(corner.vertex).push(corner);
+ }
+ for (const [vertex, around] of cornersOfVertex) {
+ const third = around.filter(corner => !corner.inBeveled && !corner.outBeveled);
+ if (around.length !== 3 || third.length !== 1) continue;
+ const [start, end] = sequenceOfLoop.get(third[0].loop);
+ if (end === undefined) continue;
+ sequenceOfLoop.set(third[0].loop, curve(vertex, start, end));
+ endsInThirdFace.add(vertex);
+ }
+
/**
* Fill a corner where three profile curves meet with a quadratic triangular Bezier patch. Each curve is a
* quadratic Bezier, so a patch built from the three corner points and the three curve controls reproduces the
@@ -366,6 +393,7 @@ export function bevelEdges(mesh, edgeRule, { width, segments = 1, profile = 0.5,
for (const vertex of edit.edgeVertices(edge)) touched.add(vertex);
}
for (const vertex of touched) {
+ if (endsInThirdFace.has(vertex)) continue;
const firstSlot = edit.vertices.arrays.edgeSlot[vertex];
const anyEdge = firstSlot >> 1;
const startLoop = edit.edgeLoops(anyEdge).map(loop => loops.vertex[loop] === vertex ? loop : loops.next[loop])[0];
@@ -423,7 +451,7 @@ export function bevelEdges(mesh, edgeRule, { width, segments = 1, profile = 0.5,
let centroid = [0, 0, 0];
for (const point of polygon) centroid = add(centroid, positionOfPoint(point));
centroid = scale(centroid, 1 / polygon.length);
- const centre = addPoint(add(centroid, scale(subtract(positionOf(vertex), centroid), profile)));
+ const centre = addPoint(add(centroid, scale(subtract(positionOf(vertex), centroid), 2 * Math.sqrt(profile) - 1)));
for (let index = 0; index < polygon.length; index++) {
builder.addFace([polygon[index], polygon[(index + 1) % polygon.length], centre], { keepTags: false, tags: [`${name}.corner`] });
cornerFaces++;
diff --git a/tests/blender-golden.test.js b/tests/blender-golden.test.js
new file mode 100644
index 00000000..3341f191
--- /dev/null
+++ b/tests/blender-golden.test.js
@@ -0,0 +1,146 @@
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import test from 'node:test';
+import { createMeshData } from '../src/mesh.js';
+import { loadMeshBooleans } from '../src/mesh-boolean.js';
+import { applyMeshEdits } from '../src/mesh-recipe.js';
+
+const FIXTURE_DIRECTORY = new URL('./fixtures/blender/', import.meta.url);
+const readFixture = name => JSON.parse(readFileSync(new URL(name, FIXTURE_DIRECTORY), 'utf8'));
+const { inputs, cases } = readFixture('cases.json');
+const golden = readFixture('golden.json');
+const knownDifferences = readFixture('differences.json');
+
+const POSITION_TOLERANCE = 1e-3;
+const MEASURE_TOLERANCE = 1e-3;
+const METRICS = ['vertexCount', 'edgeCount', 'faceCount', 'faceSizes', 'volume', 'area', 'positions'];
+
+await loadMeshBooleans();
+
+function meshFromInput({ vertices, faces }) {
+ const faceOffsets = new Uint32Array(faces.length + 1);
+ faces.forEach((face, index) => {
+ faceOffsets[index + 1] = faceOffsets[index] + face.length;
+ });
+ return createMeshData({
+ positions: new Float32Array(vertices.flat()),
+ faceOffsets,
+ cornerVertices: new Uint32Array(faces.flat()),
+ });
+}
+
+function runCase({ input, edit }) {
+ const resolveCutter = record => meshFromInput(inputs[record.type]);
+ return applyMeshEdits(meshFromInput(inputs[input]), [edit], { resolveCutter }).mesh;
+}
+
+function point(mesh, vertex) {
+ return [mesh.positions[vertex * 3], mesh.positions[vertex * 3 + 1], mesh.positions[vertex * 3 + 2]];
+}
+
+function subtract(first, second) {
+ return first.map((value, axis) => value - second[axis]);
+}
+
+function cross([ax, ay, az], [bx, by, bz]) {
+ return [ay * bz - az * by, az * bx - ax * bz, ax * by - ay * bx];
+}
+
+function dot(first, second) {
+ return first.reduce((sum, value, axis) => sum + value * second[axis], 0);
+}
+
+function measure(mesh) {
+ let volume = 0;
+ let area = 0;
+ const faceSizes = {};
+ for (let face = 0; face < mesh.faceCount; face++) {
+ const start = mesh.faceOffsets[face];
+ const end = mesh.faceOffsets[face + 1];
+ faceSizes[end - start] = (faceSizes[end - start] ?? 0) + 1;
+ const first = point(mesh, mesh.cornerVertices[start]);
+ // Summing signed triangles keeps both measures right on a concave face.
+ const vectorArea = [0, 0, 0];
+ for (let corner = start + 1; corner + 1 < end; corner++) {
+ const second = point(mesh, mesh.cornerVertices[corner]);
+ const third = point(mesh, mesh.cornerVertices[corner + 1]);
+ volume += dot(first, cross(second, third)) / 6;
+ cross(subtract(second, first), subtract(third, first)).forEach((value, axis) => {
+ vectorArea[axis] += value / 2;
+ });
+ }
+ area += Math.hypot(...vectorArea);
+ }
+ const positions = Array.from({ length: mesh.vertexCount }, (_, vertex) => point(mesh, vertex));
+ return {
+ vertexCount: mesh.vertexCount,
+ edgeCount: mesh.edgeCount,
+ faceCount: mesh.faceCount,
+ faceSizes,
+ volume: Math.abs(volume),
+ area,
+ positions,
+ };
+}
+
+function farthestFromSet(points, others) {
+ let farthest = 0;
+ for (const candidate of points) {
+ let nearest = Infinity;
+ for (const other of others) nearest = Math.min(nearest, Math.hypot(...subtract(candidate, other)));
+ farthest = Math.max(farthest, nearest);
+ }
+ return farthest;
+}
+
+function metricDifference(metric, actual, expected) {
+ if (metric === 'positions') {
+ const distance = Math.max(farthestFromSet(actual, expected), farthestFromSet(expected, actual));
+ return distance > POSITION_TOLERANCE ? `farthest vertex is ${distance.toFixed(5)} away` : null;
+ }
+ if (metric === 'faceSizes') {
+ const same = JSON.stringify(sortedEntries(actual)) === JSON.stringify(sortedEntries(expected));
+ return same ? null : `${JSON.stringify(actual)} against ${JSON.stringify(expected)}`;
+ }
+ if (metric === 'volume' || metric === 'area') {
+ const relative = Math.abs(actual - expected) / Math.max(expected, 1e-9);
+ return relative > MEASURE_TOLERANCE ? `${actual.toFixed(5)} against ${expected.toFixed(5)}` : null;
+ }
+ return actual === expected ? null : `${actual} against ${expected}`;
+}
+
+function sortedEntries(sizes) {
+ return Object.entries(sizes).sort(([first], [second]) => Number(first) - Number(second));
+}
+
+test('the golden file has a result for each case and records its Blender version', () => {
+ assert.match(golden.blenderVersion, /^5\.2/);
+ assert.deepEqual(Object.keys(golden.results).sort(), cases.map(({ id }) => id).sort());
+});
+
+test('every listed difference names a case and a metric', () => {
+ const ids = new Set(cases.map(({ id }) => id));
+ for (const [id, differences] of Object.entries(knownDifferences)) {
+ assert.ok(ids.has(id), `Unknown case ${id}`);
+ for (const [metric, reason] of Object.entries(differences)) {
+ assert.ok(METRICS.includes(metric), `Unknown metric ${metric} on ${id}`);
+ assert.ok(reason.length > 20, `${id} ${metric} needs a reason`);
+ }
+ }
+});
+
+for (const blenderCase of cases) {
+ test(`${blenderCase.id} matches Blender, apart from its listed differences`, () => {
+ const actual = measure(runCase(blenderCase));
+ const expected = golden.results[blenderCase.id];
+ const listed = knownDifferences[blenderCase.id] ?? {};
+ const problems = [];
+ for (const metric of METRICS) {
+ const difference = metricDifference(metric, actual[metric], expected[metric]);
+ if (listed[metric] && !difference) problems.push(`${metric} now matches Blender, so remove it from differences.json`);
+ if (!listed[metric] && difference) problems.push(`${metric}: ${difference}`);
+ }
+ assert.deepEqual(problems, []);
+ });
+}
+
diff --git a/tests/fixtures/blender/cases.json b/tests/fixtures/blender/cases.json
new file mode 100644
index 00000000..e97cfd1e
--- /dev/null
+++ b/tests/fixtures/blender/cases.json
@@ -0,0 +1,65 @@
+{
+ "inputs": {
+ "cube": {
+ "vertices": [[-0.5,-0.5,-0.5],[0.5,-0.5,-0.5],[0.5,0.5,-0.5],[-0.5,0.5,-0.5],[-0.5,-0.5,0.5],[0.5,-0.5,0.5],[0.5,0.5,0.5],[-0.5,0.5,0.5]],
+ "faces": [[0,3,2,1],[4,5,6,7],[0,1,5,4],[1,2,6,5],[2,3,7,6],[3,0,4,7]]
+ },
+ "cube-open": {
+ "vertices": [[-0.5,-0.5,-0.5],[0.5,-0.5,-0.5],[0.5,0.5,-0.5],[-0.5,0.5,-0.5],[-0.5,-0.5,0.5],[0.5,-0.5,0.5],[0.5,0.5,0.5],[-0.5,0.5,0.5]],
+ "faces": [[0,3,2,1],[0,1,5,4],[1,2,6,5],[2,3,7,6],[3,0,4,7]]
+ },
+ "cube-touching-plane": {
+ "vertices": [[0,-0.5,-0.5],[1,-0.5,-0.5],[1,0.5,-0.5],[0,0.5,-0.5],[0,-0.5,0.5],[1,-0.5,0.5],[1,0.5,0.5],[0,0.5,0.5]],
+ "faces": [[0,3,2,1],[4,5,6,7],[0,1,5,4],[1,2,6,5],[2,3,7,6],[3,0,4,7]]
+ },
+ "cube-away-from-plane": {
+ "vertices": [[1,-0.5,-0.5],[2,-0.5,-0.5],[2,0.5,-0.5],[1,0.5,-0.5],[1,-0.5,0.5],[2,-0.5,0.5],[2,0.5,0.5],[1,0.5,0.5]],
+ "faces": [[0,3,2,1],[4,5,6,7],[0,1,5,4],[1,2,6,5],[2,3,7,6],[3,0,4,7]]
+ },
+ "grid": {
+ "vertices": [[0,0,0],[1,0,0],[2,0,0],[3,0,0],[0,1,0],[1,1,0],[2,1,0],[3,1,0],[0,2,0],[1,2,0],[2,2,0],[3,2,0],[0,3,0],[1,3,0],[2,3,0],[3,3,0]],
+ "faces": [[0,1,5,4],[1,2,6,5],[2,3,7,6],[4,5,9,8],[5,6,10,9],[6,7,11,10],[8,9,13,12],[9,10,14,13],[10,11,15,14]]
+ },
+ "cylinder": {
+ "vertices": [[1,0,-1],[0.70710678,0.70710678,-1],[0,1,-1],[-0.70710678,0.70710678,-1],[-1,0,-1],[-0.70710678,-0.70710678,-1],[0,-1,-1],[0.70710678,-0.70710678,-1],[1,0,1],[0.70710678,0.70710678,1],[0,1,1],[-0.70710678,0.70710678,1],[-1,0,1],[-0.70710678,-0.70710678,1],[0,-1,1],[0.70710678,-0.70710678,1]],
+ "faces": [[0,1,9,8],[1,2,10,9],[2,3,11,10],[3,4,12,11],[4,5,13,12],[5,6,14,13],[6,7,15,14],[7,0,8,15],[8,9,10,11,12,13,14,15],[7,6,5,4,3,2,1,0]]
+ }
+ },
+ "cases": [
+ { "id": "extrude-region-cube-top", "input": "cube", "edit": { "op": "extrude_face_region", "select": { "normal": [0,0,1] }, "offset": 0.5 } },
+ { "id": "extrude-region-grid-block", "input": "grid", "edit": { "op": "extrude_face_region", "select": { "faces": [0,1,3,4] }, "offset": 0.5 } },
+ { "id": "extrude-region-cylinder-sides", "input": "cylinder", "edit": { "op": "extrude_face_region", "select": { "faces": [0,7] }, "offset": 0.5 } },
+ { "id": "extrude-individual-grid", "input": "grid", "edit": { "op": "extrude_individual", "select": { "faces": [0,4,8] }, "offset": 0.5 } },
+ { "id": "extrude-individual-cube-adjacent", "input": "cube", "edit": { "op": "extrude_individual", "select": { "faces": [1,3] }, "offset": 0.25 } },
+ { "id": "inset-region-cube-top", "input": "cube", "edit": { "op": "inset_region", "select": { "faces": [1] }, "thickness": 0.1 } },
+ { "id": "inset-region-cube-top-depth", "input": "cube", "edit": { "op": "inset_region", "select": { "faces": [1] }, "thickness": 0.1, "depth": -0.2 } },
+ { "id": "inset-region-grid-block", "input": "grid", "edit": { "op": "inset_region", "select": { "faces": [0,1,3,4] }, "thickness": 0.2 } },
+ { "id": "inset-region-grid-corner", "input": "grid", "edit": { "op": "inset_region", "select": { "faces": [0,1,3] }, "thickness": 0.2 } },
+ { "id": "inset-individual-grid", "input": "grid", "edit": { "op": "inset_individual", "select": { "faces": [0,1] }, "thickness": 0.2, "depth": 0.1 } },
+ { "id": "bevel-cube-all-chamfer", "input": "cube", "edit": { "op": "bevel", "edges": { "all": true }, "width": 0.1, "segments": 1 } },
+ { "id": "bevel-cube-all-round", "input": "cube", "edit": { "op": "bevel", "edges": { "all": true }, "width": 0.1, "segments": 3 } },
+ { "id": "bevel-cube-vertical", "input": "cube", "edit": { "op": "bevel", "edges": { "along": [0,0,1] }, "width": 0.1, "segments": 2 } },
+ { "id": "bevel-cube-top-rim", "input": "cube", "edit": { "op": "bevel", "edges": { "boundaryOf": { "faces": [1] } }, "width": 0.1, "segments": 2 } },
+ { "id": "bevel-cylinder-rim", "input": "cylinder", "edit": { "op": "bevel", "edges": { "boundaryOf": { "faces": [8] } }, "width": 0.1, "segments": 2 } },
+ { "id": "bevel-cube-one-edge-profile", "input": "cube", "edit": { "op": "bevel", "edges": { "between": [{ "faces": [1] }, { "faces": [3] }] }, "width": 0.1, "segments": 3, "profile": 0.7 } },
+ { "id": "bevel-cube-clamped", "input": "cube", "edit": { "op": "bevel", "edges": { "all": true }, "width": 0.8, "segments": 1, "clampOverlap": true } },
+ { "id": "loop-cut-cube-one", "input": "cube", "edit": { "op": "loop_cut", "edges": { "along": [1,0,0] }, "cuts": 1 } },
+ { "id": "loop-cut-cube-three", "input": "cube", "edit": { "op": "loop_cut", "edges": { "along": [1,0,0] }, "cuts": 3 } },
+ { "id": "loop-cut-cube-factor", "input": "cube", "edit": { "op": "loop_cut", "edges": { "along": [1,0,0] }, "cuts": 1, "factor": 0.25 } },
+ { "id": "loop-cut-grid", "input": "grid", "edit": { "op": "loop_cut", "edges": { "along": [0,1,0] }, "cuts": 1 } },
+ { "id": "loop-cut-cylinder", "input": "cylinder", "edit": { "op": "loop_cut", "edges": { "along": [0,0,1] }, "cuts": 2 } },
+ { "id": "mirror-touching-plane", "input": "cube-touching-plane", "edit": { "op": "mirror", "axis": "x", "merge": 0.001 } },
+ { "id": "mirror-away-from-plane", "input": "cube-away-from-plane", "edit": { "op": "mirror", "axis": "x", "merge": 0.001 } },
+ { "id": "array-relative-merged", "input": "cube", "edit": { "op": "array", "count": 4, "relativeOffset": [1,0,0], "merge": 0.0001 } },
+ { "id": "array-relative-apart", "input": "cube", "edit": { "op": "array", "count": 3, "relativeOffset": [2,0,0] } },
+ { "id": "array-constant", "input": "cube", "edit": { "op": "array", "count": 3, "offset": [0,0,-2], "relativeOffset": [0,0,0] } },
+ { "id": "solidify-open-inward", "input": "cube-open", "edit": { "op": "solidify", "thickness": 0.05, "offset": -1 } },
+ { "id": "solidify-open-outward", "input": "cube-open", "edit": { "op": "solidify", "thickness": 0.05, "offset": 1 } },
+ { "id": "solidify-open-uneven", "input": "cube-open", "edit": { "op": "solidify", "thickness": 0.05, "offset": -1, "evenThickness": false } },
+ { "id": "solidify-closed-shell", "input": "cube", "edit": { "op": "solidify", "thickness": 0.05, "offset": -1 } },
+ { "id": "boolean-difference-cube", "input": "cube", "edit": { "op": "boolean", "operation": "difference", "cutter": { "type": "cube" }, "translation": [0.5,0.5,0.5] } },
+ { "id": "boolean-union-cube", "input": "cube", "edit": { "op": "boolean", "operation": "union", "cutter": { "type": "cube" }, "translation": [0.5,0.5,0.5] } },
+ { "id": "boolean-intersect-cube", "input": "cube", "edit": { "op": "boolean", "operation": "intersect", "cutter": { "type": "cube" }, "translation": [0.5,0.5,0.5] } },
+ { "id": "boolean-through-hole", "input": "cube", "edit": { "op": "boolean", "operation": "difference", "cutter": { "type": "cylinder" }, "scale": [0.25,0.25,1] } }
+ ]
+}
diff --git a/tests/fixtures/blender/differences.json b/tests/fixtures/blender/differences.json
new file mode 100644
index 00000000..87bc0b51
--- /dev/null
+++ b/tests/fixtures/blender/differences.json
@@ -0,0 +1,33 @@
+{
+ "bevel-cube-all-round": {
+ "vertexCount": "Where three rounded edges meet, 67.js fills the corner with a triangular patch and Blender uses a quad grid with one centre triangle per corner.",
+ "faceCount": "The triangular corner patch of 67.js has more faces than the quad grid of Blender.",
+ "faceSizes": "The corner patch of 67.js is all triangles. The strips are quads in both.",
+ "area": "The two corner fills are different surfaces. The area differs by 0.3%.",
+ "positions": "The strips match. The inner corner points differ, because the two corner fills are different surfaces."
+ },
+ "bevel-cube-one-edge-profile": {
+ "positions": "Both place points on the same superellipse. 67.js steps by equal angle, and Blender spaces them differently when the profile is not 0.5."
+ },
+ "bevel-cube-clamped": {
+ "volume": "67.js clamps at 49% of an edge, because at 50% faces collapse to zero area. Blender clamps at 50% and keeps coincident vertices.",
+ "area": "The 49% clamp of 67.js leaves a slightly larger solid than the 50% clamp of Blender.",
+ "positions": "The 49% clamp of 67.js moves each point 0.014 from where the 50% clamp of Blender puts it."
+ },
+ "mirror-touching-plane": {
+ "faceCount": "67.js removes the wall left on the mirror plane, so the result is one solid. Blender merges the vertices and keeps one inner face.",
+ "faceSizes": "67.js has one quad fewer, because it removes the inner wall on the mirror plane.",
+ "area": "Blender counts the inner wall on the mirror plane in the area, and 67.js has no such wall."
+ },
+ "array-relative-merged": {
+ "faceCount": "67.js removes the walls between merged copies, so the result is one solid. Blender merges the vertices and keeps the walls.",
+ "faceSizes": "67.js has three quads fewer, because it removes the walls between merged copies.",
+ "volume": "The walls that Blender keeps have no single winding, so its signed volume of 5.5 is not the volume of the solid. The 67.js value of 4 is the volume of the solid.",
+ "area": "Blender counts the walls between copies in the area, and 67.js has no such walls."
+ },
+ "boolean-through-hole": {
+ "edgeCount": "67.js has no face with a hole, so it splits a holed face into triangles and quads. Blender keeps one polygon with a seam.",
+ "faceCount": "A holed face becomes many faces in 67.js and one polygon in Blender. Volume, area and vertices match.",
+ "faceSizes": "A holed face becomes triangles and quads in 67.js and a 12-sided polygon in Blender."
+ }
+}
diff --git a/tests/fixtures/blender/golden.json b/tests/fixtures/blender/golden.json
new file mode 100644
index 00000000..d8bd60b0
--- /dev/null
+++ b/tests/fixtures/blender/golden.json
@@ -0,0 +1,4226 @@
+{
+ "blenderVersion": "5.2.2 LTS",
+ "results": {
+ "extrude-region-cube-top": {
+ "vertexCount": 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
+ 0.4,
+ 0.4,
+ 0.5
+ ],
+ [
+ 0.4,
+ 0.5,
+ -0.4
+ ],
+ [
+ 0.4,
+ 0.5,
+ 0.4
+ ],
+ [
+ 0.5,
+ -0.4,
+ -0.4
+ ],
+ [
+ 0.5,
+ -0.4,
+ 0.4
+ ],
+ [
+ 0.5,
+ 0.4,
+ -0.4
+ ],
+ [
+ 0.5,
+ 0.4,
+ 0.4
+ ]
+ ]
+ },
+ "bevel-cube-all-round": {
+ "vertexCount": 96,
+ "edgeCount": 192,
+ "faceCount": 98,
+ "faceSizes": {
+ "3": 8,
+ "4": 90
+ },
+ "volume": 0.971695,
+ "area": 5.448936,
+ "positions": [
+ [
+ -0.5,
+ -0.4,
+ -0.4
+ ],
+ [
+ -0.5,
+ -0.4,
+ 0.4
+ ],
+ [
+ -0.5,
+ 0.4,
+ -0.4
+ ],
+ [
+ -0.5,
+ 0.4,
+ 0.4
+ ],
+ [
+ -0.48664,
+ -0.44993,
+ -0.4
+ ],
+ [
+ -0.48664,
+ -0.44993,
+ 0.4
+ ],
+ [
+ -0.48664,
+ -0.4,
+ -0.44993
+ ],
+ [
+ -0.48664,
+ -0.4,
+ 0.44993
+ ],
+ [
+ -0.48664,
+ 0.4,
+ -0.44993
+ ],
+ [
+ -0.48664,
+ 0.4,
+ 0.44993
+ ],
+ [
+ -0.48664,
+ 0.44993,
+ -0.4
+ ],
+ [
+ -0.48664,
+ 0.44993,
+ 0.4
+ ],
+ [
+ -0.47366,
+ -0.44782,
+ -0.44782
+ ],
+ [
+ -0.47366,
+ -0.44782,
+ 0.44782
+ ],
+ [
+ -0.47366,
+ 0.44782,
+ -0.44782
+ ],
+ [
+ -0.47366,
+ 0.44782,
+ 0.44782
+ ],
+ [
+ -0.44993,
+ -0.48664,
+ -0.4
+ ],
+ [
+ -0.44993,
+ -0.48664,
+ 0.4
+ ],
+ [
+ -0.44993,
+ -0.4,
+ -0.48664
+ ],
+ [
+ -0.44993,
+ -0.4,
+ 0.48664
+ ],
+ [
+ -0.44993,
+ 0.4,
+ -0.48664
+ ],
+ [
+ -0.44993,
+ 0.4,
+ 0.48664
+ ],
+ [
+ -0.44993,
+ 0.48664,
+ -0.4
+ ],
+ [
+ -0.44993,
+ 0.48664,
+ 0.4
+ ],
+ [
+ -0.44782,
+ -0.47366,
+ -0.44782
+ ],
+ [
+ -0.44782,
+ -0.47366,
+ 0.44782
+ ],
+ [
+ -0.44782,
+ -0.44782,
+ -0.47366
+ ],
+ [
+ -0.44782,
+ -0.44782,
+ 0.47366
+ ],
+ [
+ -0.44782,
+ 0.44782,
+ -0.47366
+ ],
+ [
+ -0.44782,
+ 0.44782,
+ 0.47366
+ ],
+ [
+ -0.44782,
+ 0.47366,
+ -0.44782
+ ],
+ [
+ -0.44782,
+ 0.47366,
+ 0.44782
+ ],
+ [
+ -0.4,
+ -0.5,
+ -0.4
+ ],
+ [
+ -0.4,
+ -0.5,
+ 0.4
+ ],
+ [
+ -0.4,
+ -0.48664,
+ -0.44993
+ ],
+ [
+ -0.4,
+ -0.48664,
+ 0.44993
+ ],
+ [
+ -0.4,
+ -0.44993,
+ -0.48664
+ ],
+ [
+ -0.4,
+ -0.44993,
+ 0.48664
+ ],
+ [
+ -0.4,
+ -0.4,
+ -0.5
+ ],
+ [
+ -0.4,
+ -0.4,
+ 0.5
+ ],
+ [
+ -0.4,
+ 0.4,
+ -0.5
+ ],
+ [
+ -0.4,
+ 0.4,
+ 0.5
+ ],
+ [
+ -0.4,
+ 0.44993,
+ -0.48664
+ ],
+ [
+ -0.4,
+ 0.44993,
+ 0.48664
+ ],
+ [
+ -0.4,
+ 0.48664,
+ -0.44993
+ ],
+ [
+ -0.4,
+ 0.48664,
+ 0.44993
+ ],
+ [
+ -0.4,
+ 0.5,
+ -0.4
+ ],
+ [
+ -0.4,
+ 0.5,
+ 0.4
+ ],
+ [
+ 0.4,
+ -0.5,
+ -0.4
+ ],
+ [
+ 0.4,
+ -0.5,
+ 0.4
+ ],
+ [
+ 0.4,
+ -0.48664,
+ -0.44993
+ ],
+ [
+ 0.4,
+ -0.48664,
+ 0.44993
+ ],
+ [
+ 0.4,
+ -0.44993,
+ -0.48664
+ ],
+ [
+ 0.4,
+ -0.44993,
+ 0.48664
+ ],
+ [
+ 0.4,
+ -0.4,
+ -0.5
+ ],
+ [
+ 0.4,
+ -0.4,
+ 0.5
+ ],
+ [
+ 0.4,
+ 0.4,
+ -0.5
+ ],
+ [
+ 0.4,
+ 0.4,
+ 0.5
+ ],
+ [
+ 0.4,
+ 0.44993,
+ -0.48664
+ ],
+ [
+ 0.4,
+ 0.44993,
+ 0.48664
+ ],
+ [
+ 0.4,
+ 0.48664,
+ -0.44993
+ ],
+ [
+ 0.4,
+ 0.48664,
+ 0.44993
+ ],
+ [
+ 0.4,
+ 0.5,
+ -0.4
+ ],
+ [
+ 0.4,
+ 0.5,
+ 0.4
+ ],
+ [
+ 0.44782,
+ -0.47366,
+ -0.44782
+ ],
+ [
+ 0.44782,
+ -0.47366,
+ 0.44782
+ ],
+ [
+ 0.44782,
+ -0.44782,
+ -0.47366
+ ],
+ [
+ 0.44782,
+ -0.44782,
+ 0.47366
+ ],
+ [
+ 0.44782,
+ 0.44782,
+ -0.47366
+ ],
+ [
+ 0.44782,
+ 0.44782,
+ 0.47366
+ ],
+ [
+ 0.44782,
+ 0.47366,
+ -0.44782
+ ],
+ [
+ 0.44782,
+ 0.47366,
+ 0.44782
+ ],
+ [
+ 0.44993,
+ -0.48664,
+ -0.4
+ ],
+ [
+ 0.44993,
+ -0.48664,
+ 0.4
+ ],
+ [
+ 0.44993,
+ -0.4,
+ -0.48664
+ ],
+ [
+ 0.44993,
+ -0.4,
+ 0.48664
+ ],
+ [
+ 0.44993,
+ 0.4,
+ -0.48664
+ ],
+ [
+ 0.44993,
+ 0.4,
+ 0.48664
+ ],
+ [
+ 0.44993,
+ 0.48664,
+ -0.4
+ ],
+ [
+ 0.44993,
+ 0.48664,
+ 0.4
+ ],
+ [
+ 0.47366,
+ -0.44782,
+ -0.44782
+ ],
+ [
+ 0.47366,
+ -0.44782,
+ 0.44782
+ ],
+ [
+ 0.47366,
+ 0.44782,
+ -0.44782
+ ],
+ [
+ 0.47366,
+ 0.44782,
+ 0.44782
+ ],
+ [
+ 0.48664,
+ -0.44993,
+ -0.4
+ ],
+ [
+ 0.48664,
+ -0.44993,
+ 0.4
+ ],
+ [
+ 0.48664,
+ -0.4,
+ -0.44993
+ ],
+ [
+ 0.48664,
+ -0.4,
+ 0.44993
+ ],
+ [
+ 0.48664,
+ 0.4,
+ -0.44993
+ ],
+ [
+ 0.48664,
+ 0.4,
+ 0.44993
+ ],
+ [
+ 0.48664,
+ 0.44993,
+ -0.4
+ ],
+ [
+ 0.48664,
+ 0.44993,
+ 0.4
+ ],
+ [
+ 0.5,
+ -0.4,
+ -0.4
+ ],
+ [
+ 0.5,
+ -0.4,
+ 0.4
+ ],
+ [
+ 0.5,
+ 0.4,
+ -0.4
+ ],
+ [
+ 0.5,
+ 0.4,
+ 0.4
+ ]
+ ]
+ },
+ "bevel-cube-vertical": {
+ "vertexCount": 24,
+ "edgeCount": 36,
+ "faceCount": 14,
+ "faceSizes": {
+ "4": 12,
+ "12": 2
+ },
+ "volume": 0.988284,
+ "area": 5.788862,
+ "positions": [
+ [
+ -0.5,
+ -0.4,
+ -0.5
+ ],
+ [
+ -0.5,
+ -0.4,
+ 0.5
+ ],
+ [
+ -0.5,
+ 0.4,
+ -0.5
+ ],
+ [
+ -0.5,
+ 0.4,
+ 0.5
+ ],
+ [
+ -0.47071,
+ -0.47071,
+ -0.5
+ ],
+ [
+ -0.47071,
+ -0.47071,
+ 0.5
+ ],
+ [
+ -0.47071,
+ 0.47071,
+ -0.5
+ ],
+ [
+ -0.47071,
+ 0.47071,
+ 0.5
+ ],
+ [
+ -0.4,
+ -0.5,
+ -0.5
+ ],
+ [
+ -0.4,
+ -0.5,
+ 0.5
+ ],
+ [
+ -0.4,
+ 0.5,
+ -0.5
+ ],
+ [
+ -0.4,
+ 0.5,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0.5,
+ 0.5,
+ 0.4
+ ]
+ ]
+ },
+ "bevel-cylinder-rim": {
+ "vertexCount": 32,
+ "edgeCount": 56,
+ "faceCount": 26,
+ "faceSizes": {
+ "4": 24,
+ "8": 2
+ },
+ "volume": 5.639434,
+ "area": 17.608314,
+ "positions": [
+ [
+ -1.0,
+ 0.0,
+ -1.0
+ ],
+ [
+ -1.0,
+ 0.0,
+ 0.9
+ ],
+ [
+ -0.9683,
+ 0.0,
+ 0.97071
+ ],
+ [
+ -0.89176,
+ 0.0,
+ 1.0
+ ],
+ [
+ -0.70711,
+ -0.70711,
+ -1.0
+ ],
+ [
+ -0.70711,
+ -0.70711,
+ 0.9
+ ],
+ [
+ -0.70711,
+ 0.70711,
+ -1.0
+ ],
+ [
+ -0.70711,
+ 0.70711,
+ 0.9
+ ],
+ [
+ -0.68469,
+ -0.68469,
+ 0.97071
+ ],
+ [
+ -0.68469,
+ 0.68469,
+ 0.97071
+ ],
+ [
+ -0.63057,
+ -0.63057,
+ 1.0
+ ],
+ [
+ -0.63057,
+ 0.63057,
+ 1.0
+ ],
+ [
+ 0.0,
+ -1.0,
+ -1.0
+ ],
+ [
+ 0.0,
+ -1.0,
+ 0.9
+ ],
+ [
+ 0.0,
+ -0.9683,
+ 0.97071
+ ],
+ [
+ 0.0,
+ -0.89176,
+ 1.0
+ ],
+ [
+ 0.0,
+ 0.89176,
+ 1.0
+ ],
+ [
+ 0.0,
+ 0.9683,
+ 0.97071
+ ],
+ [
+ 0.0,
+ 1.0,
+ -1.0
+ ],
+ [
+ 0.0,
+ 1.0,
+ 0.9
+ ],
+ [
+ 0.63057,
+ -0.63057,
+ 1.0
+ ],
+ [
+ 0.63057,
+ 0.63057,
+ 1.0
+ ],
+ [
+ 0.68469,
+ -0.68469,
+ 0.97071
+ ],
+ [
+ 0.68469,
+ 0.68469,
+ 0.97071
+ ],
+ [
+ 0.70711,
+ -0.70711,
+ -1.0
+ ],
+ [
+ 0.70711,
+ -0.70711,
+ 0.9
+ ],
+ [
+ 0.70711,
+ 0.70711,
+ -1.0
+ ],
+ [
+ 0.70711,
+ 0.70711,
+ 0.9
+ ],
+ [
+ 0.89176,
+ 0.0,
+ 1.0
+ ],
+ [
+ 0.9683,
+ 0.0,
+ 0.97071
+ ],
+ [
+ 1.0,
+ 0.0,
+ -1.0
+ ],
+ [
+ 1.0,
+ 0.0,
+ 0.9
+ ]
+ ]
+ },
+ "bevel-cube-one-edge-profile": {
+ "vertexCount": 14,
+ "edgeCount": 21,
+ "faceCount": 9,
+ "faceSizes": {
+ "4": 7,
+ "7": 2
+ },
+ "volume": 0.998773,
+ "area": 5.968181,
+ "positions": [
+ [
+ -0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ 0.5
+ ],
+ [
+ 0.4,
+ -0.5,
+ 0.5
+ ],
+ [
+ 0.4,
+ 0.5,
+ 0.5
+ ],
+ [
+ 0.4568,
+ -0.5,
+ 0.49702
+ ],
+ [
+ 0.4568,
+ 0.5,
+ 0.49702
+ ],
+ [
+ 0.49702,
+ -0.5,
+ 0.4568
+ ],
+ [
+ 0.49702,
+ 0.5,
+ 0.4568
+ ],
+ [
+ 0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ -0.5,
+ 0.4
+ ],
+ [
+ 0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ 0.4
+ ]
+ ]
+ },
+ "bevel-cube-clamped": {
+ "vertexCount": 24,
+ "edgeCount": 48,
+ "faceCount": 26,
+ "faceSizes": {
+ "3": 8,
+ "4": 18
+ },
+ "volume": 0.166667,
+ "area": 1.732051,
+ "positions": [
+ [
+ -0.5,
+ -0.0,
+ -0.0
+ ],
+ [
+ -0.5,
+ 0.0,
+ -0.0
+ ],
+ [
+ -0.5,
+ -0.0,
+ 0.0
+ ],
+ [
+ -0.5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
+ 0.5,
+ -1.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ 0.5
+ ]
+ ]
+ },
+ "solidify-open-inward": {
+ "vertexCount": 16,
+ "edgeCount": 28,
+ "faceCount": 14,
+ "faceSizes": {
+ "4": 14
+ },
+ "volume": 0.2305,
+ "area": 9.42,
+ "positions": [
+ [
+ -0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ 0.5
+ ],
+ [
+ -0.45,
+ -0.45,
+ -0.45
+ ],
+ [
+ -0.45,
+ -0.45,
+ 0.5
+ ],
+ [
+ -0.45,
+ 0.45,
+ -0.45
+ ],
+ [
+ -0.45,
+ 0.45,
+ 0.5
+ ],
+ [
+ 0.45,
+ -0.45,
+ -0.45
+ ],
+ [
+ 0.45,
+ -0.45,
+ 0.5
+ ],
+ [
+ 0.45,
+ 0.45,
+ -0.45
+ ],
+ [
+ 0.45,
+ 0.45,
+ 0.5
+ ],
+ [
+ 0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ 0.5
+ ]
+ ]
+ },
+ "solidify-open-outward": {
+ "vertexCount": 16,
+ "edgeCount": 28,
+ "faceCount": 14,
+ "faceSizes": {
+ "4": 14
+ },
+ "volume": 0.2705,
+ "area": 11.04,
+ "positions": [
+ [
+ -0.55,
+ -0.55,
+ -0.55
+ ],
+ [
+ -0.55,
+ -0.55,
+ 0.5
+ ],
+ [
+ -0.55,
+ 0.55,
+ -0.55
+ ],
+ [
+ -0.55,
+ 0.55,
+ 0.5
+ ],
+ [
+ -0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ 0.5
+ ],
+ [
+ 0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ 0.5
+ ],
+ [
+ 0.55,
+ -0.55,
+ -0.55
+ ],
+ [
+ 0.55,
+ -0.55,
+ 0.5
+ ],
+ [
+ 0.55,
+ 0.55,
+ -0.55
+ ],
+ [
+ 0.55,
+ 0.55,
+ 0.5
+ ]
+ ]
+ },
+ "solidify-open-uneven": {
+ "vertexCount": 16,
+ "edgeCount": 28,
+ "faceCount": 14,
+ "faceSizes": {
+ "4": 14
+ },
+ "volume": 0.149586,
+ "area": 9.65942,
+ "positions": [
+ [
+ -0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ -0.5,
+ 0.5,
+ 0.5
+ ],
+ [
+ -0.47113,
+ -0.47113,
+ -0.47113
+ ],
+ [
+ -0.47113,
+ 0.47113,
+ -0.47113
+ ],
+ [
+ -0.46464,
+ -0.46464,
+ 0.5
+ ],
+ [
+ -0.46464,
+ 0.46464,
+ 0.5
+ ],
+ [
+ 0.46464,
+ -0.46464,
+ 0.5
+ ],
+ [
+ 0.46464,
+ 0.46464,
+ 0.5
+ ],
+ [
+ 0.47113,
+ -0.47113,
+ -0.47113
+ ],
+ [
+ 0.47113,
+ 0.47113,
+ -0.47113
+ ],
+ [
+ 0.5,
+ -0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ 0.5
+ ]
+ ]
+ },
+ "solidify-closed-shell": {
+ "vertexCount": 16,
+ "edgeCount": 24,
+ "faceCount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5,
+ -0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ -0.5,
+ 0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ -0.5
+ ],
+ [
+ 0.5,
+ 0.5,
+ 0.5
+ ]
+ ]
+ }
+ }
+}
diff --git a/tests/mesh-bevel.test.js b/tests/mesh-bevel.test.js
index 55203e90..23200c3c 100644
--- a/tests/mesh-bevel.test.js
+++ b/tests/mesh-bevel.test.js
@@ -8,6 +8,38 @@ import { createAgentScene } from '../src/agent-scene.js';
const cube = () => meshFromGeometry(box(0, 1));
+// Interior profile points at one end of the corner at x = y = 0.5, as fractions of the width from the corner.
+function profileFractions(profile) {
+ const width = 0.1;
+ const { mesh } = bevelEdges(cube(), { along: [0, 0, 1] }, { width, segments: 3, profile });
+ const fractions = [];
+ for (let vertex = 0; vertex < mesh.vertexCount; vertex++) {
+ const [x, y, z] = mesh.positions.subarray(vertex * 3, vertex * 3 + 3);
+ if (z < 0.49 || x < 0.39 || y < 0.39) continue;
+ const across = (0.5 - x) / width;
+ const along = (0.5 - y) / width;
+ const isSlidePoint = across > 0.999 || along > 0.999;
+ if (!isSlidePoint) fractions.push([across, along]);
+ }
+ assert.equal(fractions.length, 2);
+ return fractions;
+}
+
+test('the bevel profile has the meaning it has in Blender', () => {
+ for (const [across, along] of profileFractions(0.25)) assert.ok(Math.abs(across + along - 1) < 1e-5, 'flat at 0.25');
+ for (const [across, along] of profileFractions(0.5)) assert.ok(Math.abs((1 - across) ** 2 + (1 - along) ** 2 - 1) < 1e-5, 'a circle at 0.5');
+ for (const [across, along] of profileFractions(1)) assert.ok(across < 1e-5 && along < 1e-5, 'square at 1');
+ for (const [across, along] of profileFractions(0.1)) assert.ok(across + along > 1, 'concave below 0.25');
+});
+
+test('a beveled edge that ends at a three-faced vertex adds its points to the third face, with no fan', () => {
+ const { mesh, cornerFaces } = bevelEdges(cube(), { along: [0, 0, 1] }, { width: 0.1, segments: 2 });
+ assert.equal(cornerFaces, 0);
+ assert.deepEqual([mesh.vertexCount, mesh.edgeCount, mesh.faceCount], [24, 36, 14]);
+ validateTopology(editMesh(mesh));
+ assert.equal(lintMesh(mesh).ok, true);
+});
+
function volume(mesh) {
let total = 0;
const p = mesh.positions;