Refactor Cutout Tool to Use World Space Edge Length
- Replaced the Mesh Detail parameter with a new Edge Length property to define cutout sampling in physical units. - Introduced Minimum Relative Edge Length preference to control effective spacing based on the bounding box of the cutout content. - Updated tests to validate the new edge length functionality and ensure consistent behavior across different resolutions and canvas sizes. - Removed deprecated parameters and adjusted related properties to align with the new edge length implementation. - Enhanced geometry sampling logic to utilize effective world spacing for both standard and fine outline modes.
This commit is contained in:
@@ -132,24 +132,16 @@ class PreferencesTest(BlenderTestCase):
|
||||
)
|
||||
|
||||
|
||||
def test_cutout_mesh_resolution_defaults_and_clamps_independently(self):
|
||||
preference_module = self.anyimage.preferences
|
||||
def test_cutout_relative_edge_length_defaults_and_clamps(self):
|
||||
module = self.anyimage.preferences
|
||||
preferences = self.fake_bpy.context.preferences.addons["anyimage"].preferences
|
||||
|
||||
self.assertEqual(
|
||||
preference_module.configured_max_cutout_mesh_resolution(),
|
||||
1024,
|
||||
)
|
||||
preferences.max_cutout_mesh_resolution = 2048
|
||||
self.assertEqual(
|
||||
preference_module.configured_max_cutout_mesh_resolution(),
|
||||
1024,
|
||||
)
|
||||
preferences.max_cutout_mesh_resolution = 1
|
||||
self.assertEqual(
|
||||
preference_module.configured_max_cutout_mesh_resolution(),
|
||||
4,
|
||||
)
|
||||
self.assertEqual(module.configured_min_cutout_relative_edge_length(), 0.01)
|
||||
preferences.min_cutout_relative_edge_length = 2
|
||||
self.assertEqual(module.configured_min_cutout_relative_edge_length(), 0.02)
|
||||
preferences.min_cutout_relative_edge_length = 200
|
||||
self.assertEqual(module.configured_min_cutout_relative_edge_length(), 1)
|
||||
preferences.min_cutout_relative_edge_length = 0
|
||||
self.assertAlmostEqual(module.configured_min_cutout_relative_edge_length(), 0.00001)
|
||||
|
||||
|
||||
def test_frame_resolution_defaults_and_clamps_independently(self):
|
||||
|
||||
Reference in New Issue
Block a user