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 3

Z方向に並ぶSin変位ルーバー

#grid#wave#structure#box
Z方向に並ぶSin変位ルーバー

✅ Inputs

count      : int型     複製数(例:20)
spacing    : float型   Z方向の間隔(例:2.0)
width      : float型   Boxの幅(Xサイズ)(例:5.0)
height     : float型   Boxの高さ(Yサイズ)(例:1.0)
depth      : float型   Boxの厚み(Zサイズ)(例:0.3)
amplitude  : float型   Sin波の振幅(例:2.0)
frequency  : float型   Sin波の周波数(例:0.3)

✅ Outputs

results    : List[Box] Z方向に波打つように配置されたルーバーBoxのリスト

✅ Code

import Rhino.Geometry as rg
import math

boxes = []

hx = width / 2.0
hy = height / 2.0
hz = depth / 2.0

interval_x = rg.Interval(-hx, hx)
interval_y = rg.Interval(-hy, hy)
interval_z = rg.Interval(-hz, hz)

for i in range(count):
    z = i * (height + spacing)

    y_offset = math.sin(z * frequency) * amplitude
    center = rg.Point3d(0, y_offset, z)

    plane = rg.Plane(center, rg.Vector3d.XAxis, rg.Vector3d.YAxis)
    box = rg.Box(plane, interval_x, interval_y, interval_z)
    boxes.append(box)

results = boxes
← 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 3 - Z方向に並ぶSin変位ルーバー | Grasshopper Python 入門チュートリアル | STUDIO TAMA