Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Remove points from a polygon

    General Talk
    3
    2
    704
    Loading More Posts
    • 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.
    • KantroninK
      Kantronin
      last edited by

      I have created a function that adds points to a polygon.
      But how to remove a point from a polygon, as well as remove the faces that contain it ?

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @Kantronin
        last edited by ferdinand

        Hey @kantronin,

        Thank you for reaching out to us. I would recommend having a look at the Modeling Python Examples. They are a bit hidden, but in the Geometry section I went over the general classic API geometry model of Cinema 4D.

        Regarding your core questions:

        • Removing points from a polygon: Without wanting to be overly pedantic, I must point out that polygons only index vertices, they do not hold them; CPolygon references with its fields a, b, c, and d the vertices of the PolygonObject it is attached to. In this sense removing points from a polygon is not possible, you can just de-index them. Cinema 4D expresses both triangles and quadrangles with the type CPolygon, i.e., as quadrangles. A triangle simply repeats its c index in its d index. I explained this in the modelling examples in more detail.
        • Removing vertices or polygons from a PolygonObject: There is neither a PolygonObject.RemovePolygon nor aPointObject.RemovePoint if that is what you are looking for. When you want to change the vertex or polygon count of a PolygonObject, you must call PolygonObject.ResizeObject and then call PointObject.SetAllPoints() and for each (new) polygon PolygonObject.SetPolygon. The operation_extrude_polygons_s26 example covers this subject, although I go there into the opposite direction, I increase the point and polygon count rather than decreasing it.

        PS: Useful might also be geometry_polygonobject_s26 because I explained there the type from scratch.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        ThomasBT 1 Reply Last reply Reply Quote 0
        • First post
          Last post