Skip to content

Commit

Permalink
Bug Fix - Fillet Method - T95442
Browse files Browse the repository at this point in the history
Some versions of Linux and Windows show an error with the value '_segments' in pdt_command.py
(the Fillet method).

This error manifests as not recognising the number of segments as a float value as previously.

This error does not manifest itself on MacOS, or Ubuntu versions of Blender. The values extracted
are strings of the form "4.0" so for Python to get this into an integer format it is necessary to use
a double function 'int(float([Value String]))' in line 1047 of pdt_command.py.

This modification has been checked up to Blender version 3.2 Alpha.
  • Loading branch information
Clockmender committed Feb 23, 2022
1 parent 65d10a4 commit 2cb0b2a
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 338 deletions.
26 changes: 5 additions & 21 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
#
# SPDX-License-Identifier: GPL-2.0-or-later

# <pep8 compliant>
#
# -----------------------------------------------------------------------
Expand All @@ -29,10 +13,10 @@
bl_info = {
"name": "Precision Drawing Tools (PDT)",
"author": "Alan Odom (Clockmender), Rune Morling (ermo)",
"version": (1, 5, 1),
"blender": (2, 90, 0),
"version": (1, 5, 2),
"blender": (3, 0, 0),
"location": "View3D > UI > PDT",
"description": "Precision Drawing Tools for Acccurate Modelling",
"description": "Precision Drawing Tools for Accurate Modelling",
"warning": "",
"doc_url": "https://github.com/Clockmender/Precision-Drawing-Tools/wiki",
"category": "3D View",
Expand Down
20 changes: 2 additions & 18 deletions pdt_bix.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
#
# SPDX-License-Identifier: GPL-2.0-or-later

# <pep8 compliant>
#
# ----------------------------------------------------------
Expand Down
20 changes: 2 additions & 18 deletions pdt_cad_module.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your ointersect_pointion) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
#
# SPDX-License-Identifier: GPL-2.0-or-later

# <pep8 compliant>
#
# ----------------------------------------------------------
Expand Down
26 changes: 5 additions & 21 deletions pdt_command.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
#
# SPDX-License-Identifier: GPL-2.0-or-later

# -----------------------------------------------------------------------
# Author: Alan Odom (Clockmender), Rune Morling (ermo) Copyright (c) 2019
# -----------------------------------------------------------------------
Expand Down Expand Up @@ -465,7 +448,7 @@ def command_parse(context):
mode_sel = 'SEL'

if mode == "a" and operation not in {"C", "P"}:
# Place new Vetex, or Extrude Vertices by Absolute Coords.
# Place new Vertex, or Extrude Vertices by Absolute Coords.
if mode_sel == 'REL':
pg.select = 'SEL'
mode_sel = 'SEL'
Expand Down Expand Up @@ -1060,7 +1043,8 @@ def fillet_geometry(context, pg, mode, obj, bm, verts, values):
# Note that passing an empty parameter results in that parameter being seen as "0"
# _offset <= 0 is ignored since a bevel/fillet radius must be > 0 to make sense
_offset = float(values[0])
_segments = float(values[1])
# Force _segments to an integer (bug fix T95442)
_segments = int(float(values[1]))
if _segments < 1:
_segments = 1 # This is a single, flat segment (ignores profile)
_profile = float(values[2])
Expand Down
25 changes: 4 additions & 21 deletions pdt_command_functions.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
#
# SPDX-License-Identifier: GPL-2.0-or-later

# -----------------------------------------------------------------------
# Author: Alan Odom (Clockmender), Rune Morling (ermo) Copyright (c) 2019
# -----------------------------------------------------------------------
Expand Down Expand Up @@ -90,7 +73,7 @@ def vector_build(context, pg, obj, operation, values, num_values):
pg: PDT Parameters Group - our variables
obj: The Active Object
operation: The Operation e.g. Create New Vertex
values: The paramters passed e.g. 1,4,3 for Cartesian Coordinates
values: The parameters passed e.g. 1,4,3 for Cartesian Coordinates
num_values: The number of values passed - determines the function
Returns:
Expand Down Expand Up @@ -320,7 +303,7 @@ def placement_arc_centre(context, operation):


def placement_intersect(context, operation):
"""Manipulates Geometry, or Objects by Convergance Intersection between 4 points, or 2 Edges.
"""Manipulates Geometry, or Objects by Convergence Intersection between 4 points, or 2 Edges.
Args:
context: Blender bpy.context instance.
Expand Down
27 changes: 5 additions & 22 deletions pdt_design.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
#
# SPDX-License-Identifier: GPL-2.0-or-later

# -----------------------------------------------------------------------
# Author: Alan Odom (Clockmender), Rune Morling (ermo) Copyright (c) 2019
# -----------------------------------------------------------------------
Expand Down Expand Up @@ -45,8 +28,8 @@ def execute(self, context):
Note:
- Reads pg.operate from Operation Mode Selector as 'operation'
- Reads pg.cartesian_coords scene variables to:
-- set position of CUrsor (CU)
-- set postion of Pivot Point (PP)
-- set position of Cursor (CU)
-- set position of Pivot Point (PP)
-- MoVe geometry/objects (MV)
-- Extrude Vertices (EV)
-- Split Edges (SE)
Expand Down Expand Up @@ -534,7 +517,7 @@ class PDT_OT_PlacementInt(Operator):
bl_options = {"REGISTER", "UNDO"}

def execute(self, context):
"""Manipulates Geometry, or Objects by Convergance Intersection between 4 points, or 2 Edges.
"""Manipulates Geometry, or Objects by Convergence Intersection between 4 points, or 2 Edges.
Note:
- Reads pg.operation from Operation Mode Selector as 'operation'
Expand Down
22 changes: 3 additions & 19 deletions pdt_etof.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
#
# SPDX-License-Identifier: GPL-2.0-or-later

# <pep8 compliant>
#
# ----------------------------------------------------------
Expand Down Expand Up @@ -115,7 +99,7 @@ def extend_vertex(context):

vertex_reference = v1_ref if (a_len < b_len) else v2_ref
bm.edges.new([vertex_reference, new_vertex])
bmesh.update_edit_mesh(object_data, True)
bmesh.update_edit_mesh(object_data, loop_triangles=True)

else:
failure_message_on_plane(context)
Expand Down
19 changes: 1 addition & 18 deletions pdt_exception.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later

# -----------------------------------------------------------------------
# Author: Alan Odom (Clockmender), Rune Morling (ermo) Copyright (c) 2019
Expand Down
25 changes: 4 additions & 21 deletions pdt_functions.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
# SPDX-License-Identifier: GPL-2.0-or-later

# -----------------------------------------------------------------------
# Author: Alan Odom (Clockmender), Rune Morling (ermo) Copyright (c) 2019
Expand Down Expand Up @@ -51,7 +34,7 @@ def debug(msg, prefix=""):
{prefix}{caller file name:line number}| {msg}
Args:
msg: Incomming message to display
msg: Incoming message to display
prefix: Always Blank
Returns:
Expand Down Expand Up @@ -238,7 +221,7 @@ def view_coords(x_loc, y_loc, z_loc):
z_loc: Z coordinate from vector
Returns:
Vector adjusted to View's Inverted Tranformation Matrix.
Vector adjusted to View's Inverted Transformation Matrix.
"""

areas = [a for a in bpy.context.screen.areas if a.type == "VIEW_3D"]
Expand All @@ -256,7 +239,7 @@ def view_coords_i(x_loc, y_loc, z_loc):
"""Converts Screen Oriented input Vector values to new World Vector.
Note:
Converts View tranformation Matrix to Rotational Matrix
Converts View transformation Matrix to Rotational Matrix
Args:
x_loc: X coordinate from vector
Expand Down
21 changes: 2 additions & 19 deletions pdt_library.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
#
# SPDX-License-Identifier: GPL-2.0-or-later

# -----------------------------------------------------------------------
# Author: Alan Odom (Clockmender), Rune Morling (ermo) Copyright (c) 2019
# -----------------------------------------------------------------------
Expand Down
23 changes: 3 additions & 20 deletions pdt_menus.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENCE BLOCK *****
#
# SPDX-License-Identifier: GPL-2.0-or-later

# -----------------------------------------------------------------------
# Author: Alan Odom (Clockmender), Rune Morling (ermo) Copyright (c) 2019
# -----------------------------------------------------------------------
Expand Down Expand Up @@ -412,7 +395,7 @@ def draw(self, context):
col = row.column()
col.prop(pdt_pg, "select", text="Mode")
row = layout.row()
row.label(text="Comand Line, uses Plane & Mode Options")
row.label(text="Command Line, uses Plane & Mode Options")
row = layout.row()
row.prop(pdt_pg, "command", text="")
# Try Re-run
Expand Down
Loading

0 comments on commit 2cb0b2a

Please sign in to comment.