From 9550a3cef0bb43e873bf361a4d2e00c4b249c1d7 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Mon, 15 Jan 2024 10:57:09 +0100 Subject: [PATCH 1/2] Add Mesh Extra Objects: make solids use ngons The solid mode of Add Mesh Extra Objects creates quad geometry. This decision comes from a time when ngons were not supported in Blender, before the switch to bmesh. This commit removes the conversion step, as it is better to leave it up to the user to triangulate or quadrangulate their geometry. --- add_mesh_extra_objects/add_mesh_solid.py | 32 ------------------------ 1 file changed, 32 deletions(-) diff --git a/add_mesh_extra_objects/add_mesh_solid.py b/add_mesh_extra_objects/add_mesh_solid.py index ef9cc541d..6a49f9cee 100644 --- a/add_mesh_extra_objects/add_mesh_solid.py +++ b/add_mesh_extra_objects/add_mesh_solid.py @@ -16,35 +16,6 @@ from bpy.props import ( from bpy_extras.object_utils import object_data_add -# this function creates a chain of quads and, when necessary, a remaining tri -# for each polygon created in this script. be aware though, that this function -# assumes each polygon is convex. -# poly: list of faces, or a single face, like those -# needed for mesh.from_pydata. -# returns the tessellated faces. - -def createPolys(poly): - # check for faces - if len(poly) == 0: - return [] - # one or more faces - if type(poly[0]) == type(1): - poly = [poly] # if only one, make it a list of one face - faces = [] - for i in poly: - L = len(i) - # let all faces of 3 or 4 verts be - if L < 5: - faces.append(i) - # split all polygons in half and bridge the two halves - else: - f = [[i[x], i[x + 1], i[L - 2 - x], i[L - 1 - x]] for x in range(L // 2 - 1)] - faces.extend(f) - if L & 1 == 1: - faces.append([i[L // 2 - 1 + x] for x in [0, 1, 2]]) - return faces - - # function to make the reduce function work as a workaround to sum a list of vectors def vSum(list): @@ -489,9 +460,6 @@ class Solids(bpy.types.Operator): self.snub ) - # turn n-gons in quads and tri's - faces = createPolys(faces) - # resize to normal size, or if keepSize, make sure all verts are of length 'size' if self.keepSize: rad = self.size / verts[-1 if self.dual else 0].length -- 2.30.2 From 0a6d939af68a3dc46d5c62b75f2981f949448462 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Tue, 16 Jan 2024 22:05:33 +0100 Subject: [PATCH 2/2] Add Mesh Extra Objects: Bump version --- add_mesh_extra_objects/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add_mesh_extra_objects/__init__.py b/add_mesh_extra_objects/__init__.py index a5d3c9d5b..63a9f8eed 100644 --- a/add_mesh_extra_objects/__init__.py +++ b/add_mesh_extra_objects/__init__.py @@ -13,7 +13,7 @@ bl_info = { "name": "Extra Objects", "author": "Multiple Authors", - "version": (0, 3, 10), + "version": (0, 3, 11), "blender": (2, 80, 0), "location": "View3D > Add > Mesh", "description": "Add extra mesh object types", -- 2.30.2