Page MenuHome

Python API for Constrained Delaunay
AbandonedPublic

Authored by Howard Trickey (howardt) on Aug 13 2019, 2:04 AM.

Details

Summary

Provides a mathutils.geometry function delaunay_2d_cdt to access the recently commited Constrained Delaunay Triangulation routine.

Diff Detail

Repository
rB Blender

Event Timeline

Some minor changes suggested, otherwise LGTM.

source/blender/python/mathutils/mathutils.c
356

While it's not likely to cause issues PyC_Long_AsI32 (own utility) could be used here.

Same below.

Has the advantage that it doesn't overflow quietly when converting to an int.

source/blender/python/mathutils/mathutils_geometry.c
1628

For multiple return values it's more common to use tuples.

This revision is now accepted and ready to land.Aug 13 2019, 9:10 AM
source/blender/python/mathutils/mathutils.c
356

I had thought of that but mathutils.c didn't include py_capi_utils.h, which defines PyC_Long_AsI32, and I wondered if there was a reason for not including it. But I can't see a reason, so I'll add that include and use PyC_Long_AsI32.

source/blender/python/mathutils/mathutils_geometry.c
1628

Good point. I'll change it to a tuple return.