Forgot password?

Create an account!

Forum

« back

RhinoScript – intersect curves

Messages

Please log in to write a message.

  • 5. caldescm (Sep 08, 2011 11.44):

    ok
    thanks

  • 4. Johannes (Sep 08, 2011 11.41):

    Hi, you need to use a loop structure if you want to intersect a group of curves instead of two single curves. The CurveCurveIntersection function is ok.

    johannes

  • 3. caldescm (Sep 08, 2011 11.01):

    Hi,
    Thanks for answer us so fast.
    The task we want to carrie out is to intersect a group of curves. If we select manually all the curves, we get the points by the intersect option. The problem is that we don't find this function in rhinoscript, do you know any one else function able to do this?

    Thanks again!

  • 2. Johannes (Sep 08, 2011 10.47):

    Hi, please take a closer look onto the rhinoscript help file (help, plugins, rhinoscript -> CurveCurveIntersection).

    The input are two curve identifier not an array.

            strC1 = Rhino.GetObject("Pick first crv", 4)
            strC2 = Rhino.GetObject("Pick secnd crv", 4)

            result = Rhino.CurveCurveIntersection (strC1, strC2)
           
            For i = 0 To Ubound(result)
                    If(result(i,0) = 1) Then
                            Rhino.AddPoint result(i,1)
                    End If
            Next
    johannes
  • 1. caldescm (Sep 08, 2011 10.34):

    Hi,
    we would like to intersect several curves in order to achieve the intersection points. We have test the script with the 'Curvecurveintersect' and we have found problems to run it. Please help!

    We attach the code.
    Thanks.

    'Intersección por planos principales
    Dim strObjectCua, arrStartPointCua, arrEndPointCua, dblIntervalCua, strObjectLong, arrStartPointLong, arrEndPointLong, dblIntervalLong
                         
      strObjectCua = Rhino.GetObject("Select object", interp + inters)              
      arrStartPointCua = Rhino.GetPoint("Base point of center line")
      arrEndPointCua = Rhino.GetPoint("Endpoint of center line", arrStartPointCua)
      dblIntervalCua = Rhino.RealBox ("espaciado entre cuadernas")

    If Not IsNull(dblIntervalCua) Then
        Rhino.AddSrfContourCrvs strObjectCua, arrStartPointCua, arrEndPointCua, dblIntervalCua
    End If

    strObjectLong = Rhino.GetObject("Select object", interp + inters)              
      arrStartPointLong = Rhino.GetPoint("Base point of center line")
      arrEndPointLong = Rhino.GetPoint("Endpoint of center line", arrStartPointLong)
      dblIntervalLong = Rhino.RealBox ("espaciado entre longitudinales")

    If Not IsNull(dblIntervalLong) Then
        Rhino.AddSrfContourCrvs strObjectLong, arrStartPointLong, arrEndPointLong, dblIntervalLong
    End If

    'Ocultar casco                                                                
    Dim arrLayers, CASCO, a                                                    
    arrLayers = Rhino.LayerNames

    If IsArray(arrLayers) Then
      For Each CASCO In arrLayers
        If Rhino.LayerVisible(CASCO) = True Then
          Rhino.LayerVisible CASCO, False
        End If
      Next
    End If
    Rhino.Print "nueva capa: " & Rhino.AddLayer("auxiliar", RGB(0, 300, 0))

    'Intersección líneas

    a = Rhino.GetObjects ("selecciona lineas")

    Rhino.CurveCurveIntersection a

Recommend

Why are these buttons gray?