0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rhinocerosで任意のポリサーフェースをくるくる回転させるPythonスクリプト

Last updated at Posted at 2025-06-11

個人的なメモ

実装

下記のコードをEditPythonScriptで実行する

test.py
# -*- coding: utf-8 -*-
import rhinoscriptsyntax as rs
import time
import math

# ユーザーにオブジェクトを選ばせる
obj = rs.GetObject("回転させたいオブジェクトを選んでください", rs.filter.polysurface)
if not obj:
    print("オブジェクトが選択されていません")
    exit()

# 中心点の取得(重心を使用)
center = rs.SurfaceAreaCentroid(obj)[0]

# 回転軸(Z軸)
axis = rs.VectorCreate([0,0,1], [0,0,0])

# アニメーション設定
total_time = 10.0  # 秒
steps = 360  # 1度ごとに更新
delay = total_time / steps  # 秒あたりの待機時間

# 回転処理
for i in range(steps):
    rs.RotateObject(obj, center, 1.0, axis, copy=False)
    time.sleep(delay)
    rs.Redraw()

結果

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?