Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Python API
  4. Planar cut using Python

Planar cut using Python

Scheduled Pinned Locked Moved Python API
pythonmodeling
3 Posts 2 Posters 683 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SylvainS Offline
    SylvainS Offline
    Sylvain
    ZMT
    wrote on last edited by
    #1
    import XCoreModeling
    import s4l_v1.model as model
     
    block = model.CreateSolidBlock(model.Vec3(-10,-5,-10), model.Vec3(10,10,20))
    XCoreModeling.PlanarCut(block, model.Vec3(0,0,0), model.Vec3(1.7,1.2,1.5))
    

    0_1510733111897_eceabeab-5845-436b-aa25-d1b5a015a2b0-image.png

    1 Reply Last reply
    0
    • jmtyszkaJ Offline
      jmtyszkaJ Offline
      jmtyszka
      wrote on last edited by
      #2

      Thanks for posting this Sylvain! I wasn't aware of the XCoreModeling API and I'd been looking for a way to implement object bending from python. This library solves that issue nicely.

      1 Reply Last reply
      0
      • SylvainS Offline
        SylvainS Offline
        Sylvain
        ZMT
        wrote on last edited by
        #3

        You're welcome! Note, however, that functions that are not part of the s4l_v1 module are not checked for backward compatibility between Sim4Life versions and their signatures are in principle allowed to vary (although this is quite rare, in practice). It is recommended to always try to use functions under the s4l_v1 module when possible, since only these are "officially" part of the API.

        This said, if you need to bend an object in Sim4Life v4.x or lower, use XCoreModeling.PlanarCut :-)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Search