Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[examples] Fix or disable scene tests #1919

Merged
merged 12 commits into from
Apr 2, 2021
Merged
12 changes: 4 additions & 8 deletions applications/plugins/Compliant/examples/.scene-tests
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ timeout "validations/rayleighDamping_stiffness.scn" "80"
iterations "validations/damping.scn" "10"
timeout "validations/damping.scn" "50"

# adding a few python examples
add "StructuralAPI.py"
add "contact/soup.py"
add "contact/friction_simple.py"

# sml examples
add "bielle_manivelle/scene_sml.py"

# This runs slowly, so compute only a few iterations
iterations "FEM-donuts.scn" "50"

# IGNORE ALL PYTHON SCENES
ignore ".*\.py"
ignore ".*\.pyscn"
4 changes: 4 additions & 0 deletions applications/plugins/Flexible/examples/.scene-tests
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ ignore "deformation/edgeDeformationMapping.scn"

# This scene needs time to much time to load
ignore "demos/steak_diffusion.scn"

# IGNORE ALL PYTHON SCENES
ignore ".*\.py"
ignore ".*\.pyscn"
6 changes: 6 additions & 0 deletions applications/plugins/RigidScale/examples/.scene-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This runs very slowly, so compute only a few iterations
iterations "mapping/cageLocalScaling.py" "10"
timeout "mapping/cageLocalScaling.py" "80"

# RequiredPlugin: "SohusimDev"
ignore "mapping/bonesWithRigidScaleToAffineMultiMapping.py"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
v 0. 1. 0.
v 0.5 1. 0.
v 1. 1. 0.
4 changes: 2 additions & 2 deletions applications/plugins/RigidScale/python/RigidScale/API.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def addAbsoluteMappedPoint(self, name, position=[0,0,0]):

def addMotor(self, forces=[0,0,0,0,0,0]):
## adding a constant force/torque to the rigid body (that could be driven by a controller to simulate a motor)
return self.rigidNode.createObject('ConstantForceField', template='Rigid3'+template_suffix, name='motor', points='0', forces=concat(forces))
return self.rigidNode.createObject('ConstantForceField', template='Rigid3'+template_suffix, name='motor', indices='0', forces=concat(forces))

def addBehavior(self, youngModulus=1E2, numberOfGaussPoint=100, generatedDir=None):
## adding behavior to the component
Expand Down Expand Up @@ -384,7 +384,7 @@ def addAbsoluteOffset(self, name, offset=[0,0,0,0,0,0,1]):

def addMotor(self, forces=[0,0,0,0,0,0]):
## adding a constant force/torque at the offset location (that could be driven by a controller to simulate a motor)
return self.node.createObject('ConstantForceField', template='Rigid3'+template_suffix, name='motor', points='0', forces=concat(forces))
return self.node.createObject('ConstantForceField', template='Rigid3'+template_suffix, name='motor', indices='0', forces=concat(forces))

def addMappedPoint(self, name, relativePosition=[0,0,0]):
## adding a relative position to the rigid body
Expand Down
24 changes: 23 additions & 1 deletion applications/plugins/SofaPython/examples/.scene-tests
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,26 @@ add "MultiMapping.py"
add "PythonMainScriptController.py"
#add "units.py" # it is pure python file (not a sofa scene) and should be tested in a specific unit test
# add "variables.py" # this is not a sofa scene, simply a Controller definition called in variables.scn
# add "Visitor.py"" # this is not a sofa scene, simply a visitor implementation called in Visitor.scn
# add "Visitor.py"" # this is not a sofa scene, simply a visitor implementation called in Visitor.scn

ignore "PythonAdvancedTimer/poutre_grid_sofa.py"

# ProjectionToLineMapping and ProjectionToPlaneMapping have been removed
ignore "Components/mapping/ProjectionToLineMapping.py"
ignore "Components/mapping/ProjectionToPlaneMapping.py"

# Logger test obviously emit errors
ignore "logger.py"

# Needs PySide
ignore "console.py"

# TetrahedronSetTopologyAlgorithms has been removed
ignore "RegularGridFromMesh.py"

# No such file or directory: 'PythonScene2.py'
ignore "PythonScene2.pyscn"

ignore "BaseContext.py"


Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import os
# value is passed to a "TransformEngine", that moves the mesh to these coordinates. The functionality can be inspected by looking at the properties (Inputs, Outputs) of the PSDE-object in the scene-graph.
#

path = os.path.dirname(os.path.abspath(__file__))+'/../../../../../../share/mesh/'

class PyAverageEngine(Sofa.PythonScriptDataEngine):

def parse(self):
Expand All @@ -50,7 +48,7 @@ class PyAverageEngine(Sofa.PythonScriptDataEngine):


def createScene(rootNode):
rootNode.createObject("MeshVTKLoader", name="loader", filename=path+'liver.vtk')
rootNode.createObject("MeshVTKLoader", name="loader", filename='mesh/liver.vtk')
rootNode.createObject('PythonScriptDataEngine', name='PSDE', filename=__file__, classname="PyAverageEngine")
rootNode.createObject('TransformEngine', name='TE', input_position="@loader.position", translation="@PSDE.average") #Since the type for the Data 'translation' is known, it is here that the correct Data is allocated for the PSDE
rootNode.createObject('OglModel', name="visu", position="@TE.output_position", triangles="@loader.triangles", color="1 0 0 1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import os
# This scene illustrates some additional functionality of the "PythonScriptDataEngine" (PSDE). Here, two PSDEs are chained and the types of the Data (I/Os) is explicitly declared
# For details see DataEngine.py and DataEngine2.py


path = os.path.dirname(os.path.abspath(__file__))+'/../../../../../../share/mesh/'

def createScene(rootNode):
rootNode.createObject("MeshVTKLoader", name="loader", filename=path+'liver.vtk')
rootNode.createObject("MeshVTKLoader", name="loader", filename='mesh/liver.vtk')
rootNode.createObject('PythonScriptDataEngine', name='PSDE', filename="DataEngine.py", classname="MyDataEngine")
rootNode.createObject('PythonScriptDataEngine', name='PSDE2', filename='DataEngine2.py', classname='MyDataEngine')

2 changes: 1 addition & 1 deletion applications/plugins/SofaPython/examples/PythonScene.pyscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def createArmadillo(parentNode,name,x,y,z,color):
object = node.createObject('MechanicalObject',name='mObject',dx=x,dy=y,dz=z)
mass = node.createObject('UniformMass',name='mass',totalmass='10')
node.createObject('SparseGridTopology', n='4 4 4', fileTopology='mesh/Armadillo_verysimplified.obj')
node.createObject('HexahedronFEMForceField', youngModulus='100')
node.createObject('HexahedronFEMForceField', youngModulus='100', poissonRatio='0.45')

VisuNode = node.createChild('Visu')
VisuNode.createObject('OglModel',name='Visual',filename='mesh/Armadillo_simplified.obj', color=color)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.11)

include(ExternalProject)
ExternalProject_Add(SofaPython3
GIT_REPOSITORY https://github.com/fredroy/SofaPython3
GIT_TAG origin/follow_sofa_pr1834
GIT_REPOSITORY https://github.com/sofa-framework/SofaPython3
GIT_TAG 12c7593c2eb322e221c0cba6a5c6b32caca87ba9
SOURCE_DIR "${CMAKE_SOURCE_DIR}/applications/plugins/SofaPython3"
BINARY_DIR ""
CONFIGURE_COMMAND ""
Expand Down
2 changes: 2 additions & 0 deletions applications/plugins/image/examples/.scene-tests
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ ignore "Kinect_capture.scn"
# and to have launch kinect_capture.scn
ignore "Kinect_offline.scn"

# File armadillo.mhd NOT FOUND
ignore "imageAPI.py"