"""Provides a scripting component.
    Inputs:
        x: The x script variable
        y: The y script variable
    Output:
        a: The a output variable"""

__author__ = "yie-sheng chen"
__version__ = "2022.02.22"

import rhinoscriptsyntax as rs
import math
import copy
import Rhino.Geometry as geom
# import Rhino.Curve as curv
import scriptcontext as sc
import random


def scale(curve, x,y,z):
  p0 = rs.CreatePoint(0,0,0)
  px = rs.CreatePoint(1,0,0)
  py = rs.CreatePoint(0,1,0)
  plane = geom.Plane(p0,px,py)
  scale = geom.Transform.Scale(plane,x,y,z)
  curve.Transform(scale)

p = geom.Curve.JoinCurves(x)
# print(x)
print(len(p))

scale(p[0],0.5,0.5,1)
pp = copy.copy( p[0] )
translate = geom.Transform.Translation(0, 0, 0.8)
pp.Transform(translate)
# pipes = geom.Brep.CreateFromLoft([p[1], pp],p1,p2,0, True)
a = [p[0], pp]


p = geom.Curve.JoinCurves(y)
print(y)
print(len(p))

scale(p[1],0.5,0.5,1)
pp = copy.copy( p[1] )
translate = geom.Transform.Translation(0, 0, 0.8)
pp.Transform(translate)
b = [p[1], pp]


