Skip to content

Commit 558c885

Browse files
author
Gemini
committed
simpler tie conditions
1 parent badf1db commit 558c885

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

examples/UFO/UFO.lpy

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,7 @@ def generate_points_ufo():
5252
return pts
5353

5454

55-
# def is_eligible_for_tying(module):
56-
# """
57-
# Check if a module represents an eligible branch segment for tying operations.
58-
59-
# A module is eligible if it:
60-
# - Is a 'WoodStart' symbol (completed branch segment)
61-
# - Has tying functionality
62-
# - Has a valid tie_axis (not None)
63-
64-
# Args:
65-
# module: L-System module to check
66-
67-
# Returns:
68-
# bool: True if module is eligible for tying
69-
# """
70-
# print("Checking eligibility for tying:", module)
71-
# return (module == 'WoodStart' and
72-
# hasattr(module[0].type, 'tying') and
73-
# getattr(module[0].type.tying, 'tie_axis', None) is not None)
55+
7456
support = Support(generate_points_ufo(), simulation_config.support_num_wires, simulation_config.support_spacing_wires, simulation_config.support_trunk_wire_point)
7557
num_iteration_tie = simulation_config.num_iteration_tie
7658
num_iteration_prune = simulation_config.num_iteration_prune
@@ -80,8 +62,7 @@ trunk_base.tying.guide_target = support.trunk_wire
8062

8163
def tie(lstring):
8264
for j,i in enumerate(lstring):
83-
# print("Evaluating module for tying:", i)
84-
if i == 'WoodStart' and hasattr(i[0].type, 'tying') and getattr(i[0].type.tying, 'tie_axis', None) is not None:
65+
if (i == 'WoodStart' and hasattr(i[0].type, 'tying')) and getattr(i[0].type.tying, 'tie_axis', None) is not None:
8566
if i[0].type.tying.tie_updated == False:
8667
continue
8768
curr = i[0]
@@ -139,9 +120,10 @@ label = simulation_config.label
139120
module Attractors
140121
module grow_object
141122
module bud
123+
module branch
142124
module WoodStart
143125
curve = create_bezier_curve(x_range = (-1, 1), y_range = (-1, 1), z_range = (0, 10), seed_val=time.time())
144-
Axiom: Attractors(support)SetGuide(curve, trunk_base.growth.max_length)[@GcGetPos(trunk_base.location.start)T(ParameterSet(type = trunk_base))&(270)/(0)grow_object(trunk_base)GetPos(trunk_base.location.end)]
126+
Axiom: Attractors(support)SetGuide(curve, trunk_base.growth.max_length)[@GcGetPos(trunk_base.location.start)WoodStart(ParameterSet(type = trunk_base))&(270)/(0)grow_object(trunk_base)GetPos(trunk_base.location.end)]
145127
derivation length: simulation_config.derivation_length
146128

147129
production:

stochastic_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class TyingState:
3737
has_tied: bool = False
3838
guide_points: list = None # List of (x,y,z) tuples for spline control points
3939
guide_target: any = -1 # Wire object or -1 (no target)
40-
tie_axis: tuple = (0, 1, 1) # Direction vector for the wire axis
40+
tie_axis: tuple = None # Direction vector for the wire axis
4141
tie_updated: bool = False
4242

4343
def __post_init__(self):

0 commit comments

Comments
 (0)