


{"id":407961,"date":"2025-02-01T02:29:41","date_gmt":"2025-02-01T02:29:41","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/"},"modified":"2025-02-18T16:00:03","modified_gmt":"2025-02-18T16:00:03","slug":"error-script-generating-sinusoidal-geometry","status":"answered","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/","title":{"rendered":"Error script generating sinusoidal geometry"},"content":{"rendered":"<p>&lt;p&gt;&lt;p&gt;<strong>Context: <\/strong>Need to generate a parmetric cylindrical geometry as seen below.&lt;\/p&gt;&lt;p&gt;<img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2025\/02\/01-02-2025-1738376910-mceclip0.png\" \/>&lt;\/p&gt;&lt;p&gt;<strong>Problem: <\/strong>I generated the points needed for the surface but I don&#8217;t know how to join the dots to generate the surface.&lt;\/p&gt;&lt;p&gt;<strong>Summary of code: <\/strong>Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I can do right now). Image below shows this.&lt;br&gt;<img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2025\/02\/01-02-2025-1738376938-mceclip1.png\" \/>&lt;\/p&gt;&lt;p&gt;<strong>Help wanted:<\/strong>&lt;\/p&gt;&lt;p&gt;1) Is there a method or function that can help me connect these points to form a surface?&lt;\/p&gt;&lt;p&gt;2) Is there a better way of creating this geometry? E.g. instead of generating x,y and z locations for points and generating a surface you can use the equation feature in space-claim and revolve it (NB: Tried this method &#8211; was unable to include record equation in script and as a result unable to parametrise it)&lt;\/p&gt;&lt;p&gt;<strong>Code so far:&lt;br&gt;<\/strong>&lt;\/p&gt;&lt;p&gt;import math&lt;\/p&gt;&lt;p&gt;# Define parameters&lt;br&gt;D = 0.06 &nbsp;# Diameter of the cylinder (meters)&lt;br&gt;A = 0.0016 &nbsp;# Amplitude of sinusoidal wave (meters)&lt;br&gt;W = 0.02 &nbsp;# Wavelength of sinusoidal wave (meters)&lt;br&gt;length = 0.15 &nbsp;# Length of the cylinder (meters)&lt;br&gt;segments = 100 &nbsp;# Number of points used to make the structure&lt;br&gt;revolution_steps = 36 &nbsp;# Number of steps for full 360&deg; revolution&lt;\/p&gt;&lt;p&gt;# Create a list to store the 3D coordinates&lt;br&gt;ptList = List[Point]()&lt;\/p&gt;&lt;p&gt;# Generate the 3D points by revolving the profile&lt;br&gt;for i in range(segments):&lt;br&gt;&nbsp; &nbsp; x = i * (length \/ (segments &#8211; 1))&lt;br&gt;&nbsp; &nbsp; y_base = (D \/ 2) + A * math.sin((2 * math.pi \/ W) * x) &nbsp;# Radius at current x&lt;\/p&gt;&lt;p&gt;&nbsp; &nbsp; # Generate points along the revolution&lt;br&gt;&nbsp; &nbsp; for j in range(revolution_steps):&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; angle = (2 * math.pi \/ revolution_steps) * j &nbsp;# Angle for revolution&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; y = y_base * math.cos(angle) &nbsp;# Rotate radius in the yz-plane&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; z = y_base * math.sin(angle)&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; # Create a point and add to the list&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; ptList.Add(Point.Create(x, y, z))&lt;\/p&gt;&lt;p&gt;&lt;br&gt;# Create the NURBS curve from the points&lt;br&gt;ncurve = NurbsCurve.CreateThroughPoints(False, ptList, 0.0001)&lt;\/p&gt;&lt;p&gt;# Create a curve segment from the NURBS curve&lt;br&gt;curveSegment = CurveSegment.Create(ncurve)&lt;\/p&gt;&lt;p&gt;# Create a design curve from the segment&lt;br&gt;designCurve = DesignCurve.Create(GetRootPart(), curveSegment)&lt;\/p&gt;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-407961","topic","type-topic","status-answered","hentry","topic-tag-moderator-spaceclaim","topic-tag-scripting","topic-tag-spaceclaim"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don&#039;t know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Error script generating sinusoidal geometry | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don&#039;t know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-02-01T02:29:41+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-02-18T16:00:03+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Error script generating sinusoidal geometry | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don&#039;t know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/error-script-generating-sinusoidal-geometry\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/spaceclaim\\\/#listItem\",\"name\":\"spaceclaim\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/spaceclaim\\\/#listItem\",\"position\":3,\"name\":\"spaceclaim\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/spaceclaim\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/error-script-generating-sinusoidal-geometry\\\/#listItem\",\"name\":\"Error script generating sinusoidal geometry\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/error-script-generating-sinusoidal-geometry\\\/#listItem\",\"position\":4,\"name\":\"Error script generating sinusoidal geometry\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/spaceclaim\\\/#listItem\",\"name\":\"spaceclaim\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/error-script-generating-sinusoidal-geometry\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/error-script-generating-sinusoidal-geometry\\\/\",\"name\":\"Error script generating sinusoidal geometry | Ansys Learning Forum\",\"description\":\"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don't know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/error-script-generating-sinusoidal-geometry\\\/#breadcrumblist\"},\"datePublished\":\"2025-02-01T02:29:41+00:00\",\"dateModified\":\"2025-02-18T16:00:03+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Error script generating sinusoidal geometry | Ansys Learning Forum","description":"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don't know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/spaceclaim\/#listItem","name":"spaceclaim"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/spaceclaim\/#listItem","position":3,"name":"spaceclaim","item":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/spaceclaim\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/#listItem","name":"Error script generating sinusoidal geometry"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/#listItem","position":4,"name":"Error script generating sinusoidal geometry","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/spaceclaim\/#listItem","name":"spaceclaim"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/","name":"Error script generating sinusoidal geometry | Ansys Learning Forum","description":"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don't know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/#breadcrumblist"},"datePublished":"2025-02-01T02:29:41+00:00","dateModified":"2025-02-18T16:00:03+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Error script generating sinusoidal geometry | Ansys Learning Forum","og:description":"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don't know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/","article:published_time":"2025-02-01T02:29:41+00:00","article:modified_time":"2025-02-18T16:00:03+00:00","twitter:card":"summary_large_image","twitter:title":"Error script generating sinusoidal geometry | Ansys Learning Forum","twitter:description":"Context: Need to generate a parmetric cylindrical geometry as seen below.Problem: I generated the points needed for the surface but I don't know how to join the dots to generate the surface.Summary of code: Generates x,y an z coordinates of points along surface. Draws curves that links up the surface (this is the best I"},"aioseo_meta_data":[],"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/spaceclaim\/\" title=\"spaceclaim\">spaceclaim<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tError script generating sinusoidal geometry\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"spaceclaim","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/spaceclaim\/"},{"label":"Error script generating sinusoidal geometry","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/error-script-generating-sinusoidal-geometry\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27789"],"_bbp_topic_id":["407961"],"_bbp_author_ip":["129.94.6.193"],"_bbp_last_reply_id":["422129"],"_bbp_last_active_id":["422129"],"_bbp_last_active_time":["2025-02-18 09:46:01"],"_bbp_reply_count":["1"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["274006","2328"],"_btv_view_count":["725"],"_bbp_topic_status":["answered"],"_bbp_notification_enabled":["274006"],"_bbp_subscription":["2328"],"_edit_last":["2328"]},"test":"e5cf2fb3b531780a984f74b91ac54432ea877455"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/407961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/407961\/revisions"}],"predecessor-version":[{"id":422208,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/407961\/revisions\/422208"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=407961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}