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 PolyLine using an array of points with 100 elements

how to Create PolyLine using an array of points with 100 elements

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

    Hello,

    I need to create a polyLine that goes through 100 points. Is there any way that I can write the python code which uses the array of points to generate the polyLine?

    Thanks-
    Farhana

    1 Reply Last reply
    0
    • E Offline
      E Offline
      edopao
      wrote on last edited by
      #2

      yes you can.
      Use the function CreatePolyLine from the module XCoreModeling
      This function takes a list of points as input. Points need to be Vec3 objects

      smth like:
      import XCoreModeling
      from s4l_v1.model import Vec3
      #points is your array of 100 points with spatial coordinates
      points = [Vec3(p) for p in points]
      XCoreModeling.CreatePolyline(points)

      1 Reply Last reply
      1
      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