Skip to content

Commit

Permalink
remove vertices by strip
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Nov 15, 2024
1 parent 24ca8a2 commit 4e7123c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

* Removed `compas` from requirements to solve problem in Rhino plugins.

* Removed selection of vertices on edge strip.

## [0.4.1] 2024-11-09

Expand Down
21 changes: 14 additions & 7 deletions src/compas_rui/rui.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ class Rui(object):
"""

def __init__(self, filepath):
def __init__(self, filepath, guid=None):
self.filepath = filepath
self.guid = guid or uuid.uuid4()
self.icons = []
self.macros = {}
self.toolbars = {}
Expand All @@ -187,7 +188,7 @@ def check(self):

def init(self):
with open(self.filepath, "w+") as f:
f.write(TPL_RUI.format(uuid.uuid4(), uuid.uuid4()))
f.write(TPL_RUI.format(self.guid, self.guid))
self.xml = ET.parse(self.filepath)
self.root = self.xml.getroot()
self.root_bitmaps = self.root.find("bitmaps")
Expand All @@ -207,13 +208,17 @@ def write(self):
fh.write(xml)

@classmethod
def from_json(cls, uipath, ruipath):
def from_json(cls, uipath, ruipath, guid=None) -> "Rui":
"""Construct a RUI object from a JSON config file.
Parameters
----------
configpath : str
Path to the config file.
uipath : str
Path to the UI config file.
ruipath : str
Path of the output file.
guid : uuid, optional
The guid of the plugin.
Returns
-------
Expand All @@ -225,7 +230,7 @@ def from_json(cls, uipath, ruipath):
with open(uipath, "r") as f:
ui = json.load(f)

self = cls(ruipath)
self = cls(ruipath, guid=guid)
self.init()
if ui["icons"]["bitmap"]:
bitmap = os.path.join(root, ui["icons"]["bitmap"])
Expand Down Expand Up @@ -310,7 +315,9 @@ def add_macro(
icon_guid,
)
else:
s_macro = TPL_MACRO.format(guid, name, script, tooltip, help_text, button_text, menu_text)
s_macro = TPL_MACRO.format(
guid, name, script, tooltip, help_text, button_text, menu_text
)
e_macro = ET.fromstring(s_macro)
self.root_macros.append(e_macro)
self.macros[name] = e_macro
Expand Down
5 changes: 1 addition & 4 deletions src/compas_rui/scene/meshobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RUIMeshObject(RhinoMeshObject):
# =============================================================================

def select_vertices(self, message="Select Vertices") -> list[int]:
options = ["All", "Boundary", "Degree", "EdgeLoop", "EdgeStrip", "Manual"]
options = ["All", "Boundary", "Degree", "EdgeLoop", "Manual"]
option = rs.GetString(message=message, strings=options)
if not option:
return
Expand All @@ -41,9 +41,6 @@ def select_vertices(self, message="Select Vertices") -> list[int]:
elif option == "EdgeLoop":
vertices = self.select_vertices_edgeloop()

elif option == "EdgeStrip":
vertices = self.select_vertices_edgestrip()

elif option == "Manual":
vertices = self.select_vertices_manual()

Expand Down

0 comments on commit 4e7123c

Please sign in to comment.