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. Extract the bounding box of a solid

Extract the bounding box of a solid

Scheduled Pinned Locked Moved Python API
2 Posts 2 Posters 882 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.
  • E Offline
    E Offline
    EnricoP
    wrote on last edited by
    #1

    I am trying to write the code for a EM-LF simulation with several electrodes.
    Using the GUI, in the simulation settings, when I assign the electrode solid to a field sensor setting a bouding box is automatically extracted and is linked to the field sensor setting.

    How can I extract this bounding box from code so that i can run everything from it?

    SylvainS 1 Reply Last reply
    0
    • E EnricoP

      I am trying to write the code for a EM-LF simulation with several electrodes.
      Using the GUI, in the simulation settings, when I assign the electrode solid to a field sensor setting a bouding box is automatically extracted and is linked to the field sensor setting.

      How can I extract this bounding box from code so that i can run everything from it?

      SylvainS Offline
      SylvainS Offline
      Sylvain
      ZMT
      wrote on last edited by
      #2

      There is a function that returns the bounding box of an entity.
      Let us assume you have an entity called 'object 1'. The following code should return the coordinate vectors of two diagonally opposite corners of the bounding box:

      import s4l_v1.model as model
      import XCoreModeling
      
      entity = model.AllEntities()['object 1']
      bb_lower, bb_upper = XCoreModeling.GetBoundingBox([entity])
      
      

      You can then use the model.CreateWireBlock() function to create an object which you can use in your simulation settings.

      For more detail:

      help(XCoreModeling.GetBoundingBox)
      help(model.CreateWireBlock)
      
      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