Auto-Snap on Move zurueckgenommen — zu magisch, User wollten Kontrolle
User-Feedback: bei vielen Waenden im Layout wurde unklar wann sich Wand- Endpunkte automatisch verbinden und wann nicht. Auto-Snap auf Move/Mirror machte das Verhalten unvorhersehbar. Jetzt zurueck zum Standard-BIM-Workflow: - Wand-Endpunkte verbinden sich NUR wenn User explizit Rhino's End/Mid- Snap nutzt (oder das L-Join in dJoin) - T-Junction-Detection bleibt 1mm-tight → praezise Geometrie erforderlich - Joint-Rolle (auto/durchgehend/anstossend) regelt weiterhin wer am geprueften T-Stoss durchgeht Helper _snap_endpoint_to_other_wand_axis bleibt — fuer evtl. spaetere explizite Connect-Befehle.
This commit is contained in:
@@ -1879,6 +1879,34 @@ def _make_traeger_preview(first_pt, profil, B, H, D, t, angle):
|
||||
return handler
|
||||
|
||||
|
||||
def _snap_endpoint_to_other_wand_axis(doc, my_wall_id, ep, tol=0.05):
|
||||
"""Snap einen Endpunkt auf die naechste OTHER wand_axis (within tol).
|
||||
Ignoriert self. Default 5cm — tight genug um nur intentionale Move-
|
||||
Naehe zu erfassen, lose genug um typische Snap-Drift zu fixen.
|
||||
|
||||
Return: snapped Point3d oder None wenn nichts in Reichweite."""
|
||||
if ep is None: return None
|
||||
best = None; best_d = tol
|
||||
for obj in doc.Objects:
|
||||
try:
|
||||
t = obj.Attributes.GetUserString(_KEY_TYPE) or ""
|
||||
wid = obj.Attributes.GetUserString(_KEY_ID) or ""
|
||||
except Exception: continue
|
||||
if t != "wand_axis" or wid == my_wall_id: continue
|
||||
g = obj.Geometry
|
||||
if not isinstance(g, rg.Curve): continue
|
||||
try:
|
||||
rc, par = g.ClosestPoint(ep)
|
||||
if not rc: continue
|
||||
cp = g.PointAt(par)
|
||||
d = ((cp.X - ep.X) ** 2 + (cp.Y - ep.Y) ** 2) ** 0.5
|
||||
if d > 1e-6 and d < best_d:
|
||||
best_d = d
|
||||
best = rg.Point3d(cp.X, cp.Y, ep.Z)
|
||||
except Exception: continue
|
||||
return best
|
||||
|
||||
|
||||
def _t_snap_to_wand_axis(doc, pt, tol=0.15):
|
||||
"""Snap pt auf die naechste wand_axis. Zwei Pfade:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user