Skip to content

Commit

Permalink
- parameter "Exclude height" renamed into "Restrict height" (Inner pa…
Browse files Browse the repository at this point in the history
…rameter stay unchanged, UI inverted)

- docs/nodes/CAD/stright_skeleton_2d.rst updated
  • Loading branch information
satabol committed Oct 12, 2024
1 parent d1d3017 commit 1ae8676
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
6 changes: 4 additions & 2 deletions docs/nodes/CAD/stright_skeleton_2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Stright Skeleton 2d
.. image:: https://github.com/user-attachments/assets/2a141705-62e6-489b-a4be-9333df8c7951
:target: https://github.com/user-attachments/assets/2a141705-62e6-489b-a4be-9333df8c7951

!!! **"Exclude height" parameter was renamed into "Restrict Height" !!! Images will be updated later...**

Functionality
-------------

Expand Down Expand Up @@ -39,7 +41,7 @@ Inputs
.. image:: https://github.com/user-attachments/assets/3ce5a747-9b8d-4aef-94fc-9e268425e6a6
:target: https://github.com/user-attachments/assets/3ce5a747-9b8d-4aef-94fc-9e268425e6a6

- **Taper Angle** - Angle between plane and Face that this algorithm will build.
- **Taper Angle** - Angle between plane and Face that this algorithm will build. Valid range is 0 < Taper Angle <180 Degrees; 0 and 180 are invelid angles. Also 90 degrees is invalid param if "Restrict Height" is off.

.. image:: https://github.com/user-attachments/assets/666c3a16-f124-4230-906b-8b4ea2cd699c
:target: https://github.com/user-attachments/assets/666c3a16-f124-4230-906b-8b4ea2cd699c
Expand Down Expand Up @@ -120,7 +122,7 @@ Parameters
.. image:: https://github.com/user-attachments/assets/bd119bb8-ad08-4983-be67-d97c20ad8bb3
:target: https://github.com/user-attachments/assets/bd119bb8-ad08-4983-be67-d97c20ad8bb3

- **Exclude Height** - If you want to see objects without height limits just turn it on. All objects will be recalulated without heights limits.
- **Restrict Height** (old name is "Exclude Height")- If you want to see objects without height limits just turn it off. All objects will be recalulated without heights limits (in the input field or socket).

.. raw:: html

Expand Down
26 changes: 22 additions & 4 deletions nodes/CAD/stright_skeleton_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,13 @@ def wrapper_tracked_ui_draw_op(self, layout_element, operator_idname, **keywords

ss_height: FloatProperty(
default=1.0, name="Height", update=updateNode,
description = "Max height",
description = "Max height. Disabled if (socket connected or Restrict height is off)",
) # type: ignore

# !!! Inverted in UI. Named as in a CGAL library
exclude_height: BoolProperty(
name="Exclude height",
description='Exclude height from calculations. (If you do not want change height to unlimit height)',
name="Restrict height",
description='Restrict height of object. (If no then all heights wil bu unlimited height)',
default=False, update=updateNode) # type: ignore

only_tests_for_valid: BoolProperty(
Expand Down Expand Up @@ -325,9 +326,25 @@ def draw_angles_mode_in_socket(self, socket, context, layout):
# Временно отключено
#grid.prop(self, 'angles_mode', expand=True, icon_only=True)

def draw_ss_height_in_socket(self, socket, context, layout):
grid = layout.grid_flow(row_major=False, columns=3, align=True)
col = grid.column()
col.prop(self, 'ss_height')
if socket.is_linked==True:
col.enabled = False
else:
if self.exclude_height==True:
col.enabled = False
else:
col.enabled = True
pass
#col.enabled = True
pass
pass

def draw_buttons(self, context, layout):
col = layout.column()
col.prop(self, 'exclude_height')
col.prop(self, 'exclude_height', invert_checkbox=True)
col.prop(self, 'only_tests_for_valid')
col.prop(self, 'verbose_messages_while_process')
#col.row().prop(self, 'join_mode', expand=True)
Expand Down Expand Up @@ -358,6 +375,7 @@ def sv_init(self, context):
self.inputs['ss_angles'].label = 'Angles'
self.inputs['ss_angles'].custom_draw = 'draw_angles_mode_in_socket'
self.inputs['ss_height'].label = 'Height'
self.inputs['ss_height'].custom_draw = 'draw_ss_height_in_socket'
self.inputs['objects_mask'].custom_draw = 'draw_objects_mask_in_socket'
self.inputs['file_name'].label = 'File Name'
self.inputs['file_name'].hide = True
Expand Down

0 comments on commit 1ae8676

Please sign in to comment.