Skip to content

Commit 4e7123c

Browse files
committed
remove vertices by strip
1 parent 24ca8a2 commit 4e7123c

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Removed
1515

1616
* Removed `compas` from requirements to solve problem in Rhino plugins.
17-
17+
* Removed selection of vertices on edge strip.
1818

1919
## [0.4.1] 2024-11-09
2020

src/compas_rui/rui.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ class Rui(object):
160160
161161
"""
162162

163-
def __init__(self, filepath):
163+
def __init__(self, filepath, guid=None):
164164
self.filepath = filepath
165+
self.guid = guid or uuid.uuid4()
165166
self.icons = []
166167
self.macros = {}
167168
self.toolbars = {}
@@ -187,7 +188,7 @@ def check(self):
187188

188189
def init(self):
189190
with open(self.filepath, "w+") as f:
190-
f.write(TPL_RUI.format(uuid.uuid4(), uuid.uuid4()))
191+
f.write(TPL_RUI.format(self.guid, self.guid))
191192
self.xml = ET.parse(self.filepath)
192193
self.root = self.xml.getroot()
193194
self.root_bitmaps = self.root.find("bitmaps")
@@ -207,13 +208,17 @@ def write(self):
207208
fh.write(xml)
208209

209210
@classmethod
210-
def from_json(cls, uipath, ruipath):
211+
def from_json(cls, uipath, ruipath, guid=None) -> "Rui":
211212
"""Construct a RUI object from a JSON config file.
212213
213214
Parameters
214215
----------
215-
configpath : str
216-
Path to the config file.
216+
uipath : str
217+
Path to the UI config file.
218+
ruipath : str
219+
Path of the output file.
220+
guid : uuid, optional
221+
The guid of the plugin.
217222
218223
Returns
219224
-------
@@ -225,7 +230,7 @@ def from_json(cls, uipath, ruipath):
225230
with open(uipath, "r") as f:
226231
ui = json.load(f)
227232

228-
self = cls(ruipath)
233+
self = cls(ruipath, guid=guid)
229234
self.init()
230235
if ui["icons"]["bitmap"]:
231236
bitmap = os.path.join(root, ui["icons"]["bitmap"])
@@ -310,7 +315,9 @@ def add_macro(
310315
icon_guid,
311316
)
312317
else:
313-
s_macro = TPL_MACRO.format(guid, name, script, tooltip, help_text, button_text, menu_text)
318+
s_macro = TPL_MACRO.format(
319+
guid, name, script, tooltip, help_text, button_text, menu_text
320+
)
314321
e_macro = ET.fromstring(s_macro)
315322
self.root_macros.append(e_macro)
316323
self.macros[name] = e_macro

src/compas_rui/scene/meshobject.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RUIMeshObject(RhinoMeshObject):
2424
# =============================================================================
2525

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

44-
elif option == "EdgeStrip":
45-
vertices = self.select_vertices_edgestrip()
46-
4744
elif option == "Manual":
4845
vertices = self.select_vertices_manual()
4946

0 commit comments

Comments
 (0)