Intersection points at local y, z max at multiple x locations

Quick, and likely trivial, question for anyone willing to help:

Is it possible to adjust the absolute tolerance within rhinoscriptsyntax or rhino common? The only method I am familiar with is setting a new tolerance as a function of Rhino.RhinoDoc.ModelAbsoluteTolerance; however for my application, I would like to modify the modelabsolutetolerance directly. Similar to how you would do in Options > Units > Absolute Tolerance. Please advise, thank you!

Hi @david.m.jones11,

Here is a simple example:

import rhinoscriptsyntax as rs
tol = rs.UnitAbsoluteTolerance()
if tol < 0.01:
    rs.UnitAbsoluteTolerance(0.01)

– Dale

@dale - Thank you, poor searching on my behalf when I was reviewing the rs commands.

I have another, quite different question, for you as well. I have been developing a code that automates cross-sectional curves at a user-defined number of sections over a prescribed length (of a vessel). The cross-sectional curves are then split at each intersection (ie. deck to side shell) as well as along CL. The curves are then modified to have the start point of each at the point closest to the keel and CL (start point Y & Z values less than end point Y & Z values). With use of Pascal’s DivideLengthX() code, I then add points along each curve with a user-defined spacing and stop within a certain distance of the end point (start of next curve). The problem I am experiencing is that I have points at all of the necessary intersections, with the exception of the intersection furthest outboard and above the keel for each section. At this location the curves are both intersecting at their end points (thus, no points). I cannot simply add a point at the endpt and later delete duplicates because often the hullforms have slight discontinuities at their intersections. I am stuck and out of ideas… Please help. Thank you!

Limited experience so bare with me. There are more functions but these should be enough:

def DivideLengthX():
    sc.doc.Views.Redraw()
    rs.Command('_-SelCrv')
    ids = rs.GetObjects("Select Curves",4,preselect=True)
    if not ids: return
    crvs = [sc.doc.Objects.Find(id).Geometry for id in ids]
    rs.EnableRedraw(True)
    gn = Rhino.Input.Custom.GetNumber()
    gn.SetLowerLimit(0.0,True)
    gn.AcceptNothing(False)
    gn.SetCommandPrompt("Stiffener Spacing [m]")
    gn.Get()
    stiffSpacing=gn.Number()
    for i in range(len(crvs)):
        p1=crvs[i].PointAtStart
        p2=crvs[i].PointAtEnd
        if round(p1.Z,3) > round(p2.Z,3):
            crvs[i].Reverse()
            sc.doc.Objects.Replace(ids[i],crvs[i])
        if round(p2.Y,3) == 0: #or abs(round(p1.Y,3)) > abs(round(p2.Y,3)):
            crvs[i].Reverse()
            sc.doc.Objects.Replace(ids[i],crvs[i])
    return stiffSpacing

def ExtendCrv(stiffSpacing):
    rs.Command('_-SelCrv')
    trimCrvs = rs.GetObjects("Select Curves",4,preselect=True)
    for trimCrv in trimCrvs:
        crvLength=rs.CurveLength(trimCrv)
        noStiff = crvLength/stiffSpacing
        noStiff0 = math.floor(crvLength/stiffSpacing)
        noStiff1 = round(crvLength/stiffSpacing,2)
        minSpacingfactor = 3. ###############
        minSpacing = stiffSpacing/minSpacingfactor #m
        noStiffdiff = (noStiff1 - noStiff0)*stiffSpacing
        if noStiffdiff < minSpacing:
            extendFactor = (noStiff-noStiff0)+0.99
            extendLength = extendFactor*stiffSpacing
            rs.ExtendCurveLength(trimCrv,2,1,-extendLength)
            continue
        if crvLength < 0.1:
            rs.DeleteObject(trimCrv)
    return

stiffSpacing = DivideLengthX()
ExtendCrv(stiffSpacing)

Rhino.RhinoApp.RunScript("DivideLengthX","DivideLengthX",echo=False)
rs.Command('-_SelDup')
rs.Command('-_Erase')