Skip to content

Commit

Permalink
creating roadblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
juney-lee committed Nov 10, 2024
1 parent 9733416 commit 8e94997
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 10 deletions.
10 changes: 9 additions & 1 deletion plugin/RV_force.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
def RunCommand():
session = RVSession()

form = session.find_formdiagram()
form = session.find_formdiagram(warn=False)
if not form:
print("There is no FormDiagram in the scene.")
return

force = session.find_forcediagram(warn=False)
if force:
print("ForceDiagram already exists in the scene.")
return

session.clear_all_forcediagrams()
Expand Down Expand Up @@ -49,6 +55,8 @@ def RunCommand():

rs.Redraw()

print('ForceDiagram successfully created.')

if session.settings.autosave:
session.record(name="Create Force Diagram")

Expand Down
2 changes: 2 additions & 0 deletions plugin/RV_force_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ def RunCommand():

form = session.find_formdiagram()
if not form:
print("There is no FormDiagram in the scene.")
return

force = session.find_forcediagram()
if not force:
print("There is no ForceDiagram in the scene.")
return

# =============================================================================
Expand Down
16 changes: 14 additions & 2 deletions plugin/RV_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@
def RunCommand():
session = RVSession()

pattern = session.find_pattern()
pattern = session.find_pattern(warn=False)
if not pattern:
print("There is no Pattern in the scene.")
return

session.clear_all_diagrams()
if not list(pattern.mesh.vertices_where(is_support=True)):
print("Pattern has no supports! Please define supports vertices.")
return

form = session.find_formdiagram(warn=False)
if form:
print("FormDiagram already exists in the scene.")
return

session.clear_all_formdiagrams()

# =============================================================================
# Init the form diagram
Expand Down Expand Up @@ -72,6 +82,8 @@ def RunCommand():

rs.Redraw()

print('FormDiagram successfully created.')

if session.settings.autosave:
session.record(name="Init Form Diagram")

Expand Down
1 change: 1 addition & 0 deletions plugin/RV_form_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def RunCommand():

form = session.find_formdiagram()
if not form:
print("There is no FormDiagram in the scene.")
return

# =============================================================================
Expand Down
1 change: 1 addition & 0 deletions plugin/RV_form_relax.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def RunCommand():

form = session.find_formdiagram()
if not form:
print("There is no FormDiagram in the scene.")
return

# =============================================================================
Expand Down
1 change: 1 addition & 0 deletions plugin/RV_form_smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def RunCommand():

form = session.find_formdiagram()
if not form:
print("There is no FormDiagram in the scene.")
return

# =============================================================================
Expand Down
11 changes: 5 additions & 6 deletions plugin/RV_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ def RunCommand():
patternobj = session.find_pattern(warn=False)

if patternobj:
if session.confirm("This will remove all current RhinoVAULT data and objects. Do you wish to proceed?"):
session.scene.clear()
else:
return
print("Pattern already exists in the scene.")
return

else:
session.scene.clear()
session.clear_all_patterns()

# =============================================================================
# Make a Force "Pattern"
Expand Down Expand Up @@ -111,6 +108,8 @@ def RunCommand():
session.scene.add(pattern, name=pattern.name)
session.scene.draw()

print('Pattern successfully created.')

if session.settings.autosave:
session.record(name="Make Pattern")

Expand Down
1 change: 1 addition & 0 deletions plugin/RV_pattern_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def RunCommand():

pattern = session.find_pattern()
if not pattern:
print("There is no Pattern in the scene.")
return

# =============================================================================
Expand Down
1 change: 1 addition & 0 deletions plugin/RV_pattern_openings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def RunCommand():

pattern = session.find_pattern()
if not pattern:
print("There is no Pattern in the scene.")
return

# =============================================================================
Expand Down
1 change: 1 addition & 0 deletions plugin/RV_pattern_relax.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def RunCommand():

pattern = session.find_pattern()
if not pattern:
print("There is no Pattern in the scene.")
return

# =============================================================================
Expand Down
1 change: 1 addition & 0 deletions plugin/RV_pattern_supports.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def RunCommand():

pattern = session.find_pattern()
if not pattern:
print("There is no Pattern in the scene.")
return

# =============================================================================
Expand Down
3 changes: 3 additions & 0 deletions plugin/RV_thrust_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ def RunCommand():

form = session.find_formdiagram()
if not form:
print("There is no FormDiagram in the scene.")
return

force = session.find_forcediagram()
if not force:
print("There is no ForceDiagram in the scene.")
return

thrust = session.find_thrustdiagram()
if not thrust:
print("There is no ThrustDiagram in the scene.")
return

# =============================================================================
Expand Down
11 changes: 10 additions & 1 deletion plugin/RV_tna_vertical.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ def RunCommand():

form = session.find_formdiagram()
if not form:
print("There is no FormDiagram in the scene.")
return

force = session.find_forcediagram()
if not force:
print("There is no ForceDiagram in the scene.")
return

thrust = session.find_thrustdiagram()
if not thrust:
print("There is no ThrustDiagram in the scene.")
return

# =============================================================================
Expand All @@ -48,8 +51,11 @@ def RunCommand():
# can we not use the thrust diagram here
_, scale = vertical_from_zmax(form.diagram, zmax, kmax=kmax)

if not _:
print("Vertical equilibrium failed!")
return

# store scale in force diagram
print(scale)

thrustdiagram: ThrustDiagram = form.diagram.copy(cls=ThrustDiagram)
thrustdiagram.name = "ThrustDiagram"
Expand All @@ -69,6 +75,9 @@ def RunCommand():
thrust.diagram = thrustdiagram
thrust.redraw()

print('Vertical equilibrium found!')
print('ThrustDiagram object successfully created with target height of {}.'.format(zmax))

if session.settings.autosave:
session.record(name="TNA Vertical")

Expand Down

0 comments on commit 8e94997

Please sign in to comment.