PGON defintion – help

Home Forums Problems and solutions in GDL 3D modelling PGON defintion – help

Tagged: , ,

Viewing 2 reply threads
  • Author
    Posts
    • #3553
      Pavel Čapek
      Participant

      Hello,
      I have a question for PGON definition. I follow gdl documentation https://gdl.graphisoft.com/reference-guide/primitive-elements. But I don’t understand on which base is set a MINUS or NONE sign for edge indexes.

      A negative index changes the direction of the stored normal vector or edge to the opposite in the polygon.
      (The stored vector or edge does not change; other polygons can refer to it using the original orientation with a positive index.)

      Thank you for an answer.

      Pavel Čapek
      BIM Project

    • #3643
      Péter Baksa
      Keymaster

      Hi Pavel,

      To define polygons, you have to list the indices of it’s edges. These indices are generated internally, incremented after each EDGE command, and reset to 1 with the BASE command. The edges have a direction. If you include an edge with -ID, the GDL interpreter will include the edge in opposite direction. The edge directions of a polygon should form a continuous counter-clockwise loop. When you have two neighboring polygons with a common edge, going counterclockwise around both polygons means that the common edge will be positive direction in one polygon, and negative in the other. The negative ID is a shortcut for reusing the same edge in opposite direction, you don’t have to define them twice.
      If you include an edge with ID = 0, the following edges will define a hole. The edge directions of holes should form a continuous clockwise loop.

      I hope this gets you closer to understanding.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #3644
      Pavel Čapek
      Participant

      Hi Péter,
      Thank you for your answer. After a while I discovered this by trial and error method. But I definitely make a revision of my code by your advice.

      Pavel Čapek
      BIM Project

Viewing 2 reply threads
  • The forum ‘3D modelling’ is closed to new topics and replies.