Skip to content

Commit ccf97fe

Browse files
Merge pull request #3 from RobinEnjalbert/v25.0
V25.0
2 parents 58e9598 + 8067a2e commit ccf97fe

15 files changed

+68
-17
lines changed

examples/core/export_arrows.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from os.path import join
22
from numpy import load, zeros, mean, array
33
from vedo import Mesh
4+
import webbrowser
45

56
from SimExporter.core import Exporter
67

@@ -34,3 +35,4 @@
3435
exporter.set_camera(factor=0.8, yaw=-80, pitch=60)
3536
exporter.to_html(filename=join('html', 'arrows.html'), background_color='#0D1117', grid_visible=False,
3637
menu_visible=True, frame_visible=False)
38+
webbrowser.open(join('html', 'arrows.html'))

examples/core/export_meshes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from numpy import load, mean
33
from numpy.linalg import norm
44
from vedo import Mesh
5+
import webbrowser
56

67
from SimExporter.core import Exporter
78

@@ -40,3 +41,4 @@
4041
exporter.set_camera(factor=0.8, yaw=-80, pitch=60)
4142
exporter.to_html(filename=join('html', 'meshes.html'), background_color='#0D1117', grid_visible=False,
4243
menu_visible=True, frame_visible=True)
44+
webbrowser.open(join('html', 'meshes.html'))

examples/core/export_others.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from numpy import array, float32
33
import k3d
44
from vedo import Mesh
5+
import webbrowser
56

67
from SimExporter.core import Exporter
78

@@ -31,3 +32,4 @@
3132

3233
# Export to HTML
3334
exporter.to_html(filename=join('html', 'others.html'))
35+
webbrowser.open(join('html', 'others.html'))

examples/core/export_points.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from numpy import load, mean
33
from numpy.linalg import norm
44
from vedo import Mesh
5+
import webbrowser
56

67
from SimExporter.core import Exporter
78

@@ -33,3 +34,4 @@
3334
exporter.set_camera(factor=0.8, yaw=-80, pitch=60)
3435
exporter.to_html(filename=join('html', 'points.html'), background_color='#0D1117', grid_visible=False,
3536
menu_visible=True, frame_visible=True)
37+
webbrowser.open(join('html', 'points.html'))

examples/core/export_tetra_mesh.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from os.path import join
22
from vedo import Mesh
3+
import webbrowser
34

45
from SimExporter.core import Exporter
56

@@ -29,3 +30,4 @@
2930
exporter.set_camera(factor=0.8, yaw=-80, pitch=60)
3031
exporter.to_html(filename=join('html', 'tetra.html'), background_color='grey', grid_visible=False, menu_visible=True,
3132
frame_visible=True)
33+
webbrowser.open(join('html', 'tetra.html'))

examples/core/github_gallery.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from numpy import load, mean, tile
33
from numpy.linalg import norm
44
from vedo import Mesh
5+
import webbrowser
56

67
from SimExporter.core import Exporter
78

@@ -70,3 +71,4 @@
7071
exporter.set_camera(factor=0.55, yaw=-90, pitch=60)
7172
exporter.to_html(filename=join('html', 'gallery.html'), background_color='#0D1117', grid_visible=False,
7273
menu_visible=False, frame_visible=False)
74+
webbrowser.open(join('html', 'gallery.html'))

examples/core/mimesis_website.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from os.path import join
66
from numpy import load
77
from vedo import Mesh
8+
import webbrowser
89

910
from SimExporter.core import Exporter
1011

@@ -39,3 +40,4 @@
3940
exporter.set_camera(factor=0.8, yaw=-75, pitch=65)
4041
exporter.to_html(filename=join('html', 'website.html'), background_color="#030929", grid_visible=False,
4142
menu_visible=False, frame_visible=False)
43+
webbrowser.open(join('html', 'website.html'))

examples/sofa/data/plugins.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
Sofa.Component.AnimationLoop
2-
Sofa.Component.Collision.Detection.Algorithm
3-
Sofa.Component.Collision.Detection.Intersection
4-
Sofa.Component.ODESolver.Backward
5-
Sofa.Component.LinearSolver.Iterative
2+
Sofa.Component.Constraint.Lagrangian.Solver
3+
Sofa.Component.Constraint.Projective
64
Sofa.Component.IO.Mesh
7-
Sofa.Component.SolidMechanics.FEM.Elastic
5+
Sofa.Component.LinearSolver.Iterative
6+
Sofa.Component.Mapping.Linear
87
Sofa.Component.Mass
9-
Sofa.GL.Component.Rendering3D
108
Sofa.Component.MechanicalLoad
11-
Sofa.Component.Constraint.Projective
9+
Sofa.Component.ODESolver.Backward
10+
Sofa.Component.SolidMechanics.FEM.Elastic
11+
Sofa.Component.StateContainer
12+
Sofa.Component.Topology.Container.Dynamic
1213
Sofa.Component.Topology.Mapping
14+
Sofa.Component.Visual
15+
Sofa.GL.Component.Rendering3D

examples/sofa/export_logo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from os.path import join
22
import numpy as np
3+
import webbrowser
34

45
import Sofa.Gui
56

@@ -38,7 +39,7 @@ def displacement_field():
3839
colormap_function=displacement_field)
3940

4041
# Init the SOFA simulation AFTER creating the exporter (otherwise, callbacks will not work)
41-
Sofa.Simulation.init(node)
42+
Sofa.Simulation.initRoot(node)
4243

4344
# Launch the SOFA Gui, run a few time steps
4445
Sofa.Gui.GUIManager.Init(program_name="main", gui_name="qglviewer")
@@ -51,3 +52,4 @@ def displacement_field():
5152
exporter.set_camera(factor=0.8, yaw=0, pitch=0)
5253
exporter.to_html(filename=join('html', 'sofa.html'), background_color='black', grid_visible=False,
5354
menu_visible=True, frame_visible=True)
55+
webbrowser.open(join('html', 'sofa.html'))

examples/sofa/simulation.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ def __init__(self, root: Sofa.Core.Node, *args, **kwargs):
2323
root.addObject('RequiredPlugin', pluginName=required_plugins)
2424
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showForceFields')
2525
root.addObject('DefaultAnimationLoop')
26-
root.addObject('GenericConstraintSolver', maxIterations=10, tolerance=1e-3)
27-
root.addObject('CollisionPipeline')
28-
root.addObject('BruteForceBroadPhase')
29-
root.addObject('BVHNarrowPhase')
30-
root.addObject('DiscreteIntersection')
31-
root.addObject('DefaultContactManager')
3226

3327
# Create the logo object node
3428
root.addChild('logo')
@@ -56,7 +50,7 @@ def __init__(self, root: Sofa.Core.Node, *args, **kwargs):
5650
node.addObject(Simulation(root=node))
5751

5852
# Init the SOFA simulation
59-
Sofa.Simulation.init(node)
53+
Sofa.Simulation.initRoot(node)
6054

6155
# Launch the SOFA Gui, run a few time steps
6256
Sofa.Gui.GUIManager.Init(program_name="main", gui_name="qglviewer")

0 commit comments

Comments
 (0)