<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[n-gones with python]]></title><description><![CDATA[<p dir="auto">I found that the c ++ sdk had a routine for creating n-gones, but I did not find anything in python. By importing a wavefront that contains n-gones with my plugin, the import is not done properly. Is there a python solution or should I convert my plugin to c ++?</p>
]]></description><link>http://developers.maxon.net/forum/topic/11138/n-gones-with-python</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 21:33:29 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/11138.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Nov 2018 20:06:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to n-gones with python on Wed, 14 Nov 2018 10:11:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/eziopan">@<bdi>eZioPan</bdi></a><br />
thank you for this example very clear <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title=";)" alt="😉" /></p>
]]></description><link>http://developers.maxon.net/forum/post/56365</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/56365</guid><dc:creator><![CDATA[Passion3D]]></dc:creator><pubDate>Wed, 14 Nov 2018 10:11:39 GMT</pubDate></item><item><title><![CDATA[Reply to n-gones with python on Wed, 14 Nov 2018 05:30:03 GMT]]></title><description><![CDATA[<p dir="auto">hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/passion3d">@<bdi>passion3d</bdi></a>,<br />
There is <strong>no</strong> actual n-gon in the underlying layer of Cinema 4D.<br />
Adjacent polygons use <code>hidden edge</code> to create n-gon-like shape(s).</p>
<p dir="auto">Following code creates a <strong>5-side polygon object</strong>:</p>
<pre><code class="language-python">import c4d, math
from c4d import utils
#Welcome to the world of Python

def main():
    pointCount = 5
    polygonCount = math.ceil(pointCount/4.0)                    # caculate minimum needed polygon number
    polyObj = c4d.BaseObject(c4d.Opolygon)                      # create an empty polygon object

    polyObj.ResizeObject(pcnt=pointCount, vcnt=polygonCount)    # resize object to have 5 points, 2 polygons

    # manually set all point position
    polyObj.SetPoint(id=0, pos=c4d.Vector(200,0,-200))
    polyObj.SetPoint(id=1, pos=c4d.Vector(-200,0,-200))
    polyObj.SetPoint(id=2, pos=c4d.Vector(-200,0,200))
    polyObj.SetPoint(id=3, pos=c4d.Vector(200,0,200))
    polyObj.SetPoint(id=4, pos=c4d.Vector(300,0,0))

    # associate points into polygons
    polygon0 = c4d.CPolygon(t_a=0, t_b=1, t_c=2, t_d=3)
    polygon1 = c4d.CPolygon(t_a=0, t_b=3, t_c=4)

    # set polygon in polygon object
    polyObj.SetPolygon(id=0, polygon=polygon0)
    polyObj.SetPolygon(id=1, polygon=polygon1)

    # set hidden edge
    nbr = utils.Neighbor()
    nbr.Init(op=polyObj, bs=None)                               # create Neighor counting all polygon in
    edge = c4d.BaseSelect()
    edge.Select(num=3)                                          # set selection, which is the id of the edge to be hidden
    polyObj.SetSelectedEdges(e=nbr, pSel=edge, ltype=c4d.EDGESELECTIONTYPE_HIDDEN)  # hide the edge

    polyObj.Message(c4d.MSG_UPDATE)

    doc.InsertObject(polyObj)

    c4d.EventAdd()

if __name__=='__main__':
    main()
</code></pre>
]]></description><link>http://developers.maxon.net/forum/post/56362</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/56362</guid><dc:creator><![CDATA[eZioPan]]></dc:creator><pubDate>Wed, 14 Nov 2018 05:30:03 GMT</pubDate></item></channel></rss>