Code Monkey home page Code Monkey logo

stlib's People

Contributors

aboudfayad avatar adagolodjo avatar alxbilger avatar damienmarchal avatar eulaliecoevoet avatar fredroy avatar guparan avatar louise-scherrer avatar marques-bruno avatar mthieffry avatar olivier-goury avatar olivier-roussel avatar paulchaillou avatar pchaillo avatar samfabrice avatar vannestefelix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

stlib's Issues

CMake file gives configuration errors

I am trying to build the library using cmake on windows, but I get the following error every time I try to:
cmake CMake Error at CMakeLists.txt:19 (sofa_set_python_directory): Unknown CMake command "sofa_set_python_directory".
I tried adding the SofaMacros.cmake, but with no luck.

Issue on [CableGripper] Tutorials

Hi,

I followed the tutorial of DefrostSofaBundle/plugins/SoftRobots/docs/sofapython3/tutorials/CableGripper/cablegripper-tuto.md to create my own cube&floor scene, and I figured out that the tutorial is out-dated in terms of the VisualModel.

From the Line# 54 The tutorial asked me to modify the */CableGripper/myproject/cablegripper.py file like the following:

from stlib3.visuals import ShowGrid
from stlib3.physics.rigid import Floor
from stlib3.physics.rigid import Cube

def createScene(rootNode):
    """This is my first scene"""
    ShowGrid(rootNode)

    Floor(rootNode,
          translation=[0.0,0.0,0.0],
          isAStaticObject=True)

    Cube(rootNode,
          translation=[0.0,0.0,0.0])


    return rootNode

However, the terminal log shows that there is no such module called ShowGrid in the visuals package

[ERROR]   [SofaPython3::SceneLoader] Unable to completely load the scene from file '/home/jeremy/DefrostSofaBundle/plugins/SoftRobots/docs/sofapython3/tutorials/CableGripper/myproject/cablegripper.py'.  
Python exception:   
  ImportError: cannot import name 'ShowGrid' from 'stlib3.visuals' (/home/jeremy/DefrostSofaBundle/plugins/STLIB/lib/python3/site-packages/stlib3/visuals/__init__.py)

Hence, I checked with the source code here and think the right expression based on the current structure of stlib3 should be like this:

from stlib3.visuals.visualmodel import VisualModel
def createScene(rootNode):
    VisualModel.showGrid(rootNode)

Hope this might help. Thank you.

No module named 'stlib3'

As in the title, once I try to launch the tripod-tutorial.py I get the following message:

[ERROR] [SofaPython3::SceneLoader] Unable to completely load the scene from file 'C:\Users*******\Desktop\aaasofa\tripod-tuto.py'.
Python exception:
ModuleNotFoundError: No module named 'stlib3'

At:
C:\Users******\Desktop\aaasofa\tripod-tuto.py(1):
(219): _call_with_frames_removed
(848): exec_module
(6):

What should I do? I checked and the stlib3 folder is where it should be (/plugins/STLIB/lib/python3/site-packages/)

stlib not added to python path by SofaPython

Hi, when the plugin is loaded I had to add the path to stlib manually (disclaimer: I use the binary distributed by the soft robot plugin). In particular the plugin folder does not contain something like lib/python2.7/site-packages

problem with function getOrientedBoxFromTransform

There is a problem in the new implementation of getOrientedBoxFromTransorm, it creates a bug on step3 of the TRIPOD tutorial

67c1d51#r32599793

@damienmarchal could you have a look at it ?

euler Rotation is a vec3
rotation is a quat

Why are you mixing them ?
The good design, I think, should be to provide the user a function that transforms euler to quat...but then, inside the functions, always use quat...

ElasticMaterialObject scale argument only applied to FEM model

The scaling is not applied to the visual model and the collision mesh. Only the 'forcefield' is scaled properly.

def createScene(rootNode):
    from stlib.scene import MainHeader, ContactHeader    
    MainHeader(rootNode, gravity=[0.0,-981.0,0.0])
    ContactHeader(rootNode, alarmDistance=15, contactDistance=10)
    
    from stlib.scene import Scene
    scene=Scene(rootNode)
    from splib.objectmodel import setData
    setData(scene.VisualStyle, displayFlags="showBehavior showForceFields")
    
    from stlib.scene import Node
    obj = Node(rootNode, "Mon object")
    
    from stlib.physics.deformable import ElasticMaterialObject
    eobject = ElasticMaterialObject(obj,
                                   volumeMeshFileName="test.vtk",
                                   poissonRatio=0.3,
                                   youngModulus=18000,
                                   totalMass=0.5,
                                   surfaceColor=[0.0, 0.8, 0.7],
                                   surfaceMeshFileName="test.stl",
                                   scale = [3.0, 3.0, 3.0],
                                   collisionMesh = "test.stl"
                                   )
                                   
    from stlib.physics.constraints import FixedBox
    fixingBox=[-20.0,-20.0,-20.0,20.0,20.0,20.0]
    FixedBox(eobject.node, atPositions=fixingBox, doVisualization=True)
    
    
    return rootNode

Python code missing in the packaging of STLIB (release versions)

Hi

Current packaging of STLIB is not working as the python code is not included in the packaging.
In some old version of this packaging v21.06.03, in STLIB/lib/ there was a folder "python3/site-packages" that included the python code...
Is it possible to put it back ?

[running error] with stlib.pyscn

Dear,
When I run the ./runsofa with the stlib.pyscn I have the error in my terminal as follows.
image
And I have download the STLIB and compile it successfully.
When I run the ./runsofa, the plugin will be loaded automosly.
And I would like to inquire what's wrong with this.
image

Best regards,
Beal

[stlib3] Wrong use of properties in VisualModel

Hi,

Following the discussion from this issue, the way we use the properties in the prefab VisualModel is not correct.
Adding the components of the prefab from the init() method and using the properties results in odd behaviors due to the data callback mechanism.
We should update these prefabs:

  • stlib3/visuals/VisualModel
  • stlib3/physics/deformable/ElasticMaterialObject

Building with Sofa v20.06 or master

Hello,

I am trying to build Sofa with STLIB and softrobots plugins with v20.06.

However I get the error: (running ubuntu 20.04 more output
configure_output.txt
attached)

CMake Error at /home/arthur/Documents/sofa/plugins/STLIB/CMakeLists.txt:42 (sofa_create_package_with_targets):
Unknown CMake command "sofa_create_package_with_targets".

I noticed the binaries on the softrobotic webpage were for v19.04 so I was wondering if this was an issue with the version of Sofa I am using?
Is there a version of STLIB that is compatible with v20.06? Or could this be a different kind of problem?

Bug numerics TRS_to_matrix function

When trying to launch the sofiaLeg demo provided by the ModelOrderReduction plugin, the newBox function did not work for me. I noticed that TRS_to_matrix() does not initiate the rotation quaternion when a zero rotation is given. It can be fixed by adding the following lines:

if eulerRotation != None:
      rotation = from_euler( to_radians( eulerRotation ) )
else:
      rotation = [0, 0, 0, 1]

[STLIB/python/stlib/physics/deformable/elasticmaterialobject.py]TypeError: 'staticmethod' object is not callable

In the file STLIB/python/stlib/physics/deformable/elasticmaterialobject.py need to resolve the problem : TypeError: 'staticmethod' object is not callable
File "step0.pyscn", line 11, in createScene
Gripper(rootNode)
File "gripper.py", line 14, in Gripper
pullPointLocation=[3, 10.5, 3])
File "finger.py", line 39, in Finger
translation=translation)
File "/home/younes/travail/plugin/STLIB/python/splib/objectmodel/init.py", line 47, in call
o = self.cls(*args, **kwargs)
File "/home/younes/travail/plugin/STLIB/python/stlib/physics/deformable/elasticmaterialobject.py", line 30, in init
collisionMesh, withConstrain, surfaceColor, poissonRatio, youngModulus, totalMass, solver)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.