Add tests and implement boundary smoothing and cutout functionality
- Introduced tests for boundary smoothing in `test_boundary_smoothing.py`, verifying that smoothing reduces stair-step artifacts while preserving boundary integrity. - Added tests for cutout boundary behavior in `test_cutout_boundary.py`, ensuring proper handling of boundary triangles and normal blending. - Created `test_temporary_attributes.py` to check the cleanup of temporary attributes across depth modifier branches, ensuring no warnings are raised. - Implemented point culling functionality in `test_validity.py`, confirming that invalid points are removed without affecting adjacent geometry. - Developed boundary smoothing logic in `boundary_smoothing.py`, allowing for depth smoothing while maintaining edge integrity. - Added cutout boundary management in `cutout_boundary.py`, including functions for removing boundary triangles and tapering thickness profiles. - Implemented validity checks in `validity.py` to ensure proper deletion of invalid vertices and associated wire edges.
This commit is contained in:
@@ -81,12 +81,17 @@ def artifacts(tmp_path, source):
|
||||
|
||||
def test_result_replaces_source_with_zero_rotation_and_shadeless_material(source, artifacts, monkeypatch):
|
||||
result, operator = artifacts
|
||||
saved = bpy.data.node_groups.new("O Image Depth Panorama", "GeometryNodeTree")
|
||||
saved["anyimage_asset_revision"] = 11
|
||||
matrix = Matrix.Translation((2, -3, 4)) @ Matrix.Rotation(0.6, 4, "Y") @ Matrix.Diagonal((2, 3, 4, 1))
|
||||
source.matrix_world = matrix
|
||||
source.empty_image_offset = (0.3, -0.8)
|
||||
undo = Mock(return_value={"FINISHED"})
|
||||
monkeypatch.setattr(conversion, "bpy", SimpleNamespace(data=bpy.data, ops=SimpleNamespace(ed=SimpleNamespace(undo_push=undo))))
|
||||
obj = conversion.create_panorama_from_result(bpy.context, result, operator)
|
||||
assert obj.modifiers[0].node_group != saved
|
||||
assert obj.modifiers[0].node_group["anyimage_asset_revision"] == 14
|
||||
assert saved in bpy.data.node_groups.values() and saved["anyimage_asset_revision"] == 11
|
||||
assert obj.name == operator.source_object_name and obj.type == "MESH"
|
||||
np.testing.assert_allclose(obj.location, matrix.translation, atol=1e-6)
|
||||
np.testing.assert_allclose(obj.scale, matrix.to_scale(), atol=1e-6)
|
||||
|
||||
Reference in New Issue
Block a user