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. How to create solid circle ie. with surface ?

How to create solid circle ie. with surface ?

Scheduled Pinned Locked Moved Solved Python API
4 Posts 2 Posters 474 Views 2 Watching
  • 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.
  • D Offline
    D Offline
    dbsim4
    wrote on last edited by dbsim4
    #1

    Hello,

    I'm trying to make a circle as a solid 2D surface (ie. filled in) with the Python API using s4l.model.CreateCircle(...)

    But it's showing up as an empty ring (ie. a 1D line circle, no fill).

    How can I fill it in so that it creates a solid circular surface (flat 2D, not like a 3D cylinder).

    Thank you!

    • Doug
    brynB 1 Reply Last reply
    0
    • D Offline
      D Offline
      dbsim4
      wrote on last edited by
      #2

      Update: The intersection method didn't work:
      Unable to assign '....' as a Waveguide Source in simulation 'EM'

      • I'm not sure why it's trying to make it a waveguide (I intend to use Edge sources); but I'm assuming it's failing because of the curved geometry of the intersection with the arc of the circle... so... ideas? It would be perfect to connect the gaps in the circle with lines. I just need to be able to find the endpoints of each arc, to connect them.
      brynB 1 Reply Last reply
      0
      • D dbsim4

        Hello,

        I'm trying to make a circle as a solid 2D surface (ie. filled in) with the Python API using s4l.model.CreateCircle(...)

        But it's showing up as an empty ring (ie. a 1D line circle, no fill).

        How can I fill it in so that it creates a solid circular surface (flat 2D, not like a 3D cylinder).

        Thank you!

        • Doug
        brynB Offline
        brynB Offline
        bryn
        ZMT
        wrote on last edited by bryn
        #3

        @dbsim4

        This is the same behavior as in the GUI. To create a circular surface you can first create a circle loop, and then cover the loop. In python:

        # create a circle loop
        circle = XCoreModeling.CreateCircle(Vec3(0, 0, 0), Vec3(0, 0, 1), 5.0)
        # cover the loop
        XCoreModeling.CoverWireBody(circle)
        

        Note the s4l_v1 api is a wrapper around the low-level API implemented in modules like XCoreModeling. We don't automatically add all functions to s4l_v1. While CreateCircle is wrapped/included in s4l_v1, the function CoverWireBody is not (yet) wrapped.

        1 Reply Last reply
        1
        • D dbsim4

          Update: The intersection method didn't work:
          Unable to assign '....' as a Waveguide Source in simulation 'EM'

          • I'm not sure why it's trying to make it a waveguide (I intend to use Edge sources); but I'm assuming it's failing because of the curved geometry of the intersection with the arc of the circle... so... ideas? It would be perfect to connect the gaps in the circle with lines. I just need to be able to find the endpoints of each arc, to connect them.
          brynB Offline
          brynB Offline
          bryn
          ZMT
          wrote on last edited by
          #4

          @dbsim4 regarding your "Update", I am not sure I understand the context. Are you trying to assign the circle loop as an edge source?

          1 Reply Last reply
          0
          • SylvainS Sylvain has marked this topic as solved on
          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