Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5745

Increasing vs Decreasing Interval and Transformation

$
0
0

@somnarchbulist wrote:

Hi
i’m creating a box with random intervals and whenever i have a DECREASING Interval my translation doesn’t work properly. I guess i am missing a piece of information about transformations etc. can anybody help?
Thanks!

import Rhino as rh
import rhinoscriptsyntax as rs
import math
import random
import string



_bPoint = rh.Geometry.Point3d(0,0,0);
_zVec = rh.Geometry.Vector3d.ZAxis

_bPlane = rh.Geometry.Plane(_bPoint, _zVec);

intS = 100;

x1 = random.uniform(-intS,intS);
x2 = random.uniform(-intS,intS);
y1 = random.uniform(-intS,intS);
y2 = random.uniform(-intS,intS);
z1 = random.uniform(-intS,intS);
z2 = random.uniform(-intS,intS);

xS = rh.Geometry.Interval(x1,x2);
yS = rh.Geometry.Interval(y1,y2);
zS = rh.Geometry.Interval(z1,z2);

_cube = rh.Geometry.Box(_bPlane, xS, yS, zS);
_newCube = rh.Geometry.Box(_bPlane, xS, yS, zS);

trans = rh.Geometry.Transform.Translation(200,200,200);
rh.Geometry.Box.Transform(_newCube, trans);


a = _cube
b= _newCube

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5745

Trending Articles