Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Odom <clockmender@icloud.com>2020-02-16 22:57:38 +0300
committerRune Morling <ermo.blender.org@spammesenseless.net>2020-03-28 20:55:43 +0300
commitf58fe4df0da454bc69b70589d1111aefaa36a182 (patch)
treecdd6002fb45e07d5549d6f678417a8a4a32d1470 /precision_drawing_tools
parent1d5837400d0bc55862b082065b3594996aa5f4d4 (diff)
PDT: Further Expansion of Tangent System
This is still WIP. Further expand options to work in any plane and from selected vertices. DocStrings Added. Code refactored. Further testing is still required before this can be released for general use.
Diffstat (limited to 'precision_drawing_tools')
-rw-r--r--precision_drawing_tools/__init__.py7
-rw-r--r--precision_drawing_tools/pdt_exception.py4
-rw-r--r--precision_drawing_tools/pdt_functions.py2
-rw-r--r--precision_drawing_tools/pdt_menus.py58
-rw-r--r--precision_drawing_tools/pdt_msg_strings.py3
5 files changed, 55 insertions, 19 deletions
diff --git a/precision_drawing_tools/__init__.py b/precision_drawing_tools/__init__.py
index 298b2d9c..4aeecd26 100644
--- a/precision_drawing_tools/__init__.py
+++ b/precision_drawing_tools/__init__.py
@@ -413,6 +413,9 @@ class PDTSceneProperties(PropertyGroup):
name="Coordst3", default=(0.0, 0.0, 0.0), subtype="XYZ", description=PDT_DES_TANCEN3
)
tangent_from_point: BoolProperty(name="From Point", default=False, description=PDT_DES_TPOINT)
+ menu_expand: BoolProperty(
+ name="Expand", default=False, description="Expand/Collapse Menu",
+ )
class PDTPreferences(AddonPreferences):
@@ -502,8 +505,12 @@ classes = (
pdt_pivot_point.PDT_OT_PivotWrite,
pdt_pivot_point.PDT_OT_PivotRead,
pdt_tangent.PDT_OT_TangentOperate,
+ pdt_tangent.PDT_OT_TangentOperateSel,
pdt_tangent.PDT_OT_TangentSet1,
pdt_tangent.PDT_OT_TangentSet2,
+ pdt_tangent.PDT_OT_TangentSet3,
+ pdt_tangent.PDT_OT_TangentSet4,
+ pdt_tangent.PDT_OT_TangentExpandMenu,
pdt_view.PDT_OT_ViewRot,
pdt_view.PDT_OT_ViewRotL,
pdt_view.PDT_OT_ViewRotR,
diff --git a/precision_drawing_tools/pdt_exception.py b/precision_drawing_tools/pdt_exception.py
index d0dc157a..601f5141 100644
--- a/precision_drawing_tools/pdt_exception.py
+++ b/precision_drawing_tools/pdt_exception.py
@@ -85,3 +85,7 @@ class ShaderError(Exception):
class FeatureError(Exception):
"""Wrong Feature Type Error Exception."""
pass
+
+class DistanceError(Exception):
+ """Invalid Distance (Separation) Error."""
+ pass
diff --git a/precision_drawing_tools/pdt_functions.py b/precision_drawing_tools/pdt_functions.py
index 3d12c4f9..38879618 100644
--- a/precision_drawing_tools/pdt_functions.py
+++ b/precision_drawing_tools/pdt_functions.py
@@ -111,6 +111,7 @@ def set_mode(mode_pl):
Note:
Sets indices of axes for locational vectors:
+ a3 is normal to screen, or depth
"XY": a1 = x, a2 = y, a3 = z
"XZ": a1 = x, a2 = z, a3 = y
"YZ": a1 = y, a2 = z, a3 = x
@@ -126,6 +127,7 @@ def set_mode(mode_pl):
"XY": (0, 1, 2),
"XZ": (0, 2, 1),
"YZ": (1, 2, 0),
+ "LO": (0, 1, 2),
}
return order[mode_pl]
diff --git a/precision_drawing_tools/pdt_menus.py b/precision_drawing_tools/pdt_menus.py
index 1632730c..649b2b96 100644
--- a/precision_drawing_tools/pdt_menus.py
+++ b/precision_drawing_tools/pdt_menus.py
@@ -426,30 +426,50 @@ class PDT_PT_PanelTangent(Panel):
def draw(self,context):
layout = self.layout
pdt_pg = context.scene.pdt_pg
- # First Centre & Radius
- row = layout.row()
- split = row.split(factor=0.35, align=True)
- split.label(text="Centre 1")
- split.prop(pdt_pg, "tangent_point0", text="")
- row = layout.row()
- split = row.split(factor=0.45, align=False)
- split.operator("pdt.tangentset1", text="Set From Arc")
- split.prop(pdt_pg, "tangent_radius0", text="")
- # Second Centre & Radius
+ if pdt_pg.menu_expand:
+ icon_e = "EVENT_C"
+ else:
+ icon_e = "EVENT_E"
row = layout.row()
- split = row.split(factor=0.35, align=True)
- split.label(text="Centre 2")
- split.prop(pdt_pg, "tangent_point1", text="")
+ row.label(text=f"Working {PDT_LAB_PLANE}:")
+ row.prop(pdt_pg, "plane", text="")
row = layout.row()
- split = row.split(factor=0.45, align=False)
- split.operator("pdt.tangentset2", text="Set From Arc")
- split.prop(pdt_pg, "tangent_radius1", text="")
-
+ row.operator("pdt.tangentoperatesel", text="Tangents from Selection", icon="NONE")
row = layout.row()
- row.operator("pdt.tangentoperate", text="Execute", icon="NONE")
+ row.label(text="Or Use Tangents From Inputs")
+ row.operator("pdt.tangentexpandmenu", text="", icon=icon_e)
+
+ box = layout.box()
+ row = box.row()
row.prop(pdt_pg, "tangent_from_point", text="From Point")
- row = layout.row()
+ row = box.row()
split = row.split(factor=0.35, align=True)
split.label(text="Tan Point")
split.prop(pdt_pg, "tangent_point2", text="")
+ row = box.row()
+ row.operator("pdt.tangentset3", text="from Cursor")
+ row.operator("pdt.tangentset4", text="from Vertex")
+
+ if pdt_pg.menu_expand:
+ box = layout.box()
+ row = box.row()
+ split = row.split(factor=0.35, align=True)
+ split.label(text="Centre 1")
+ split.prop(pdt_pg, "tangent_point0", text="")
+ row = box.row()
+ split = row.split(factor=0.45, align=False)
+ split.operator("pdt.tangentset1", text="Set From Arc")
+ split.prop(pdt_pg, "tangent_radius0", text="")
+
+ # Second Centre & Radius
+ row = box.row()
+ split = row.split(factor=0.35, align=True)
+ split.label(text="Centre 2")
+ split.prop(pdt_pg, "tangent_point1", text="")
+ row = box.row()
+ split = row.split(factor=0.45, align=False)
+ split.operator("pdt.tangentset2", text="Set From Arc")
+ split.prop(pdt_pg, "tangent_radius1", text="")
+ row = box.row()
+ row.operator("pdt.tangentoperate", text="Tangents From Inputs", icon="NONE")
diff --git a/precision_drawing_tools/pdt_msg_strings.py b/precision_drawing_tools/pdt_msg_strings.py
index 9eeb08f1..0233a8c1 100644
--- a/precision_drawing_tools/pdt_msg_strings.py
+++ b/precision_drawing_tools/pdt_msg_strings.py
@@ -151,6 +151,9 @@ PDT_ERR_2CPNPE = "Select 2 Co-Planar Non-Parallel Edges"
PDT_ERR_NCEDGES = "Edges must be Co-Planar Non-Parallel Edges, Selected Edges aren't"
PDT_ERR_1EDGE1FACE = "Select 1 face and 1 Detached Edge"
PDT_ERR_NOINT = "No Intersection Found"
+PDT_ERR_BADDISTANCE = "Invalid Distance (Separtion) Error; Chosen Points too Close"
+PDT_ERR_MATHSERROR = "Maths Error - Check Working Plane"
+PDT_ERR_SAMERADII = "Circles have the same radius - Just offset the Edge between centres"
# Info messages
#