ChatGPT knows RhinoCommon

Hi all, sorry if this was already posted :slight_smile: (I have searched the forum but did not find any results)

well… it looks like ChatGPT knows the RhinoCommon library, but because ChatGPT data is from 2021 I guess it has studied on the available RhinoCommon in 2021 that probably has some differences from the current one?

anyways, my brain has been continuously exploding and imploding for the last hour:
you can ask ChatGPT to write code for GH
don’t know how much complex you can go… will give it a try in the coming days

import random
import Rhino.Geometry as rg

# Number of points to generate
numPoints = IN[0]

# Size of each chunk
chunkSize = IN[1]

# Create a list of random points
points = [rg.Point3d(random.uniform(-10, 10), random.uniform(-10, 10), 0) for i in range(numPoints)]

# Split the list of points into chunks
chunks = [points[i:i + chunkSize] for i in range(0, len(points), chunkSize)]

# Draw a NURBS curve for each chunk of points
curves = []
for chunk in chunks:
    curve = rg.NurbsCurve.Create(chunk, 3)
    curves.append(curve)

# Output the curves
OUT = curves

a few little things to correct here and there… but WOW

4 Likes

the other topics about chatGPT

ok, chatGPT is written as a single word :+1: this teaches me a lot :slight_smile:


Its been really nice for creating quick Regex syntax.

when that will work for grasshopper… :space_invader:

You might want to change the topic title so it says ChatGPT?

1 Like

And Copilot

1 Like