STUDIO TAMA

Rhinoceros & Grasshopper Utilities

Home

GH Sample Files

GH Python Tutorials

Rhino Assets

Books

Blog

Plugins

About

Privacy Policy

Terms of Service

Contact

© 2025 STUDIO TAMA

Day 4

波打つ球体リング

#sphere#wave#circle#polar
波打つ球体リング

✅ Inputs

count      : int型     球の数(例:24)
radius     : float型   円の半径(例:10.0)
size       : float型   各球の半径(例:1.0)
amplitude  : float型   Z方向の振幅(例:2.0)
frequency  : float型   Sin波の周波数(例:2.0)

✅ Outputs

results    : List[Sphere] 円周上に波打つように配置された球体のリスト

✅ Code

import Rhino.Geometry as rg
import math

spheres = []

angle_step = 360.0 / count

for i in range(count):
    angle_deg = i * angle_step
    angle_rad = math.radians(angle_deg)

    x = radius * math.cos(angle_rad)
    y = radius * math.sin(angle_rad)
    z = math.sin(angle_rad * frequency) * amplitude

    center = rg.Point3d(x, y, z)
    sphere = rg.Sphere(center, size)
    spheres.append(sphere)

results = spheres
← Back to Grasshopper Python Tutorials

License & Terms of Use

ItemAllowedDescription
Integration into your projectsYou are free to use the code as part of your scripts or works, whether for personal or commercial purposes.
Code modification & learning useCustomizing the code for your own learning or specific purposes is very welcome.
Sharing on SNS / showcasingNo permission is required to share images or URLs of your works. Please feel free to showcase them!
Redistribution / republishing×Do not publish the code or files in their entirety as content on your own site or elsewhere.
Reselling as materials/programs×Do not sell the content of this site, either as-is or with only minor modifications, for a fee.
Copyright notice / linkOptionalNot required, but including a link to the source would be greatly appreciated.
Day Day 4 - 波打つ球体リング | Grasshopper Python 入門チュートリアル | STUDIO TAMA