Forgot password?

Create an account!

Forum

« back

RhinoScript – Boolean Union problem in RhinoScript

Messages

Please log in to write a message.

  • 2. topcusevki (Oct 27, 2016 22.43):

    Please have a look at the initial objects used as input objects

    Boolean Union problem in RhinoScript
  • 1. topcusevki (Oct 27, 2016 22.39):

    Hi,

    Quite new to rhinoscript ( just started today ) but I have prior knowledge of vb.

    I am trying to apply boolean union on two polysurfaces which are previously splitted by a planar surface. These can be seen in the code below also.

    Although I am able to apply booleanunion manually, I couldn't do it in rhinoscript.

    The operation always returns as null. I would appriciate it if someone can figure it out.


    p.s. input objects are attached.

    Option Explicit
    'Script written by sevki topcu
    'Script copyrighted by sevki topcu
    'Script version 27 October 2016 17:31:28
    Dim geo_cutter
    Dim geo_box
    Dim iteration_step
    Dim rotation_angle_a
    Dim rotation_angle_b
    Dim rotation_angle_c

    Call Main()
    Sub Main()
            ' kullan?c?dan input al?nmas?
            geo_box = Rhino.GetObject("manipule edilecek obje sec")
            Dim konum1
            Dim konum2
            geo_cutter = Rhino.GetObject("kesici düzlem")
            iteration_step = Rhino.GetInteger("How many steps")
            rotation_angle_a = Rhino.GetInteger("Rotation Angle1?")
            '       rotation_angle_b = Rhino.GetInteger("Rotation Angle2?")
            'rotation_angle_c = Rhino.GetInteger("Rotation Angle3?")
           
            konum1 = array(0, 0, 0)
            konum2 = Array(30, 0, 0)
           
            geo_box = Rhino.copyObject(geo_box, konum1, konum2)
            geo_cutter = Rhino.MoveObject(geo_cutter, konum1, konum2)

            For i = 0 To 1
                   
                    Dim splitted_objects:splitted_objects = Rhino.SplitBrep(geo_box, geo_cutter, True)
           
           
                    Dim geo_split1: geo_split1 = splitted_objects(0)
                    Dim geo_split2: geo_split2 = splitted_objects(1)
           
           
           
                    Dim points_axes: points_axes = rhino.GetPoints("donme eksenlerini belirlemek için 4 nokta seç")
           
                    Dim arraxes_vector : arraxes_vector = Array(Rhino.VectorCreate(points_axes(0), points_axes(1)), Rhino.VectorCreate(points_axes(0), points_axes(2)), Rhino.VectorCreate(points_axes(0), points_axes(3)))
           
                    geo_split1 = Rhino.RotateObject(geo_split1, points_axes(0), rotation_angle_a, arraxes_vector(0), False)
                    geo_split1 = Rhino.RotateObject(geo_split1, points_axes(0), rotation_angle_a, arraxes_vector(1), False)
                    geo_split1 = Rhino.RotateObject(geo_split1, points_axes(0), rotation_angle_a, arraxes_vector(2), False)
                   
                   
                    points_axes = rhino.GetPoints("donme eksenlerini belirlemek için 4 nokta seç")
                   
                    geo_split2 = Rhino.RotateObject(geo_split2, points_axes(0), rotation_angle_a, arraxes_vector(0), False)
                    geo_split2 = Rhino.RotateObject(geo_split2, points_axes(0), rotation_angle_a, arraxes_vector(1), False)
                    geo_split2 = Rhino.RotateObject(geo_split2, points_axes(0), rotation_angle_a, arraxes_vector(2), False)
                   
                   
                   
                    geo_split1 = Rhino.CapPlanarHoles(geo_split1)
                    geo_split2 = Rhino.CapPlanarHoles(geo_split2)
                   
           
                   
                    splitted_objects(0) = geo_split1
                    splitted_objects(1) = geo_split2
                   
                    If IsArray(splitted_objects) Then
                   
                    geo_box = Rhino.BooleanUnion(splitted_objects, False)
                           
                    If Not IsNull(a) Then
                    geo_box = Rhino.copyObject(geo_split1, konum1, konum2)
                    geo_cutter = Rhino.copyObject(geo_cutter, konum1, konum2)
                   
                    End If
                   
                    End If
           
    i = i + 1
            Next
                   
    Rhino.Print "done"
           
    End Sub
Recommend

Why are these buttons gray?