def grid(self, sqr, x, y): xpldCrv = rs.ExplodeCurves(sqr) rs.ReverseCurve(xpldCrv[0]) rs.ReverseCurve(xpldCrv[3]) crvPoints = [] for i in range(len(xpldCrv)): curve = xpldCrv[i] if i % 2 == 0: crvPoints.append(rs.DivideCurve(curve, x)) else: crvPoints.append(rs.DivideCurve(curve, y)) #divide up the curve into points based on x and y #add the resulting points to the curvePoints List. Each of the resulting points sets are a list themsleves for p1, p2 in zip(crvPoints[0], crvPoints[2]): #draw a line between p1, p2 print(p1) #rs.AddLine(p1,p2) self.penUp() self.goto(p1[0], p1[1], p1[2]) self.penDown() self.goto(p2[0], p2[1], p2[2]) for p1, p2 in zip(crvPoints[1], crvPoints[3]): self.penUp() l = self.goto(p1[0], p1[1], p1[2]) self.penDown() self.goto(p2[0], p2[1], p2[2])
def Flip_crv(crvs, index_a, index_b): if rs.CurveDirectionsMatch(crvs[index_a], crvs[index_b]): A = crvs[index_a] B = crvs[index_b] else: A = crvs[index_a] B = rs.ReverseCurve(crvs[index_b]) return (A, B)
def SentidoNo(cirDir, no, Plano, cirRaio): pOr, eX, eY, eZ = Plano planoAux = rs.PlaneFromNormal(no, eZ) Circulo = rs.AddCircle(planoAux, cirRaio) dir1 = rs.ClosedCurveOrientation(cirDir, eZ) dir2 = rs.ClosedCurveOrientation(Circulo, eZ) if not dir1 == dir2: rs.ReverseCurve(Circulo) return Circulo
def AddTEtoOpenAirfoil(AirfoilCurve): # If the airfoil curve given as an argument is open at the trailing edge, it adds # a line between the ends of the curve and joins this with the rest of the curve. if rs.IsCurveClosed(AirfoilCurve) == False: EP1 = rs.CurveEndPoint(AirfoilCurve) rs.ReverseCurve(AirfoilCurve) EP2 = rs.CurveEndPoint(AirfoilCurve) rs.ReverseCurve(AirfoilCurve) Closure = rs.AddLine(EP1, EP2) rs.UnselectAllObjects() rs.SelectObject(Closure) rs.SelectObject(AirfoilCurve) rs.Command("_Join ") LO = rs.LastCreatedObjects() AirfoilCurve = LO[0] rs.UnselectAllObjects() return AirfoilCurve
def show_specialized(self, island): curve_id = self.show_line(island) island.cut_edge_lines.append(curve_id) if self.has_outer_joinery: curves = island.joinerySystem.outer_joinery(curve_id, left_side=False) rs.AddObjectsToGroup(curves, self.group_name) else: rs.ReverseCurve( curve_id) #necessary to reverse direction so edges match curves = island.joinerySystem.inner_joinery(curve_id, left_side=False) rs.AddObjectsToGroup(curves, self.group_name)
def setCurveDir(objs): count = 0 for obj in objs: # if rs.IsCurve(obj) and rs.IsCurvePlanar(obj): if rs.IsCurve(obj): normal = rs.CurveNormal(obj) if normal and normal[2] < 0: count += 1 rs.ReverseCurve(obj) # print "Curve {} flipped {}{}".format(obj, normal, normal2) print "reversed " + str(count) + " curves"
def setCurveDir(objs): count = 0 for obj in objs: if rs.IsCurve(obj) and rs.IsCurvePlanar(obj): sp = rs.AddPoint(rs.CurveEndPoint(obj)) tangent = rs.CurveTangent(obj, rs.CurveDomain(obj)[0]) print tangent p2 = rs.CopyObject(sp, tangent * -10) rs.AddPoint(p2) # rs.Command("Dir") # for i in range(0,rs.PolyCurveCount(obj)): # l = rs.CurveLength(obj,i) # if l < 4: # print l # layer=rs.ObjectLayer(obj) # segments = rs.ExplodeCurves(obj, True) # obj = rs.JoinCurves(segments, True) # rs.ObjectLayer(obj, layer) # rs.ObjectLayer(obj, layer) normal = rs.CurveNormal(obj) result = rs.CurveAreaCentroid(obj) if result: print normal start = result[0] end = (result[0].X + 100 * normal[0], result[0].Y + 100 * normal[1], result[0].Z + 100 * normal[2]) rs.AddLine(result[0], end) if normal and normal[2] < 0: count += 1 rs.ReverseCurve(obj) # print "Curve {} flipped {}{}".format(obj, normal, normal2) # try to find discontinuities print "reversed " + str(count) + " curves"
def setCurveDir(objs): rs.UnselectAllObjects() count = 0 count2 = 0 for obj in objs: if rs.IsCurve(obj) and rs.IsCurveClosed(obj): # 1 = CW, -1 = CCW, 0 = N/A # -1 if the curve's orientation is counter-clockwise # 0 if unable to compute the curve's orientation if rs.ClosedCurveOrientation(obj) == 0: if DEBUG_FLIPCUVRVE: rs.SelectObject(obj) return False count2 += 1 if rs.ClosedCurveOrientation(obj) == 1: rs.ReverseCurve(obj) count += 1 if DEBUG_FLIPCUVRVE: rs.SelectObject(obj) # normal = rs.CurveNormal(obj) # if normal and normal[2] < 0: # count += 1 # rs.ReverseCurve(obj) # rs.SelectObject(obj) rs.EnableRedraw(True) rs.EnableRedraw(False) print "reversed curves " + str(count) + " curves" if DEBUG_FLIPCUVRVE: rs.MessageBox("reversed curves " + str(count) + " curves") if count2 > 0: rs.MessageBox("Curve direction of " + str(count) + " curves could not be determined") return True
def initSlice(self, init_geo): result = [] plane = rs.PlaneFromPoints((-5000, -5000, 0), (0, -5000, 0), (-5000, 0, 0)) planeSrf = rs.AddPlaneSurface(plane, 10000, 10000) crv = rs.IntersectBreps(init_geo, planeSrf) result.append(crv) while True: vec = rs.CreateVector((0, 0, self.layer_height)) planeSrf = rs.MoveObject(planeSrf, vec) crv = rs.IntersectBreps(init_geo, planeSrf) if crv == None: break else: result.append(crv) result = rs.JoinCurves(result) for i in range(1, len(result)): if not rs.CurveDirectionsMatch(result[0], result[i]): rs.ReverseCurve(result[i]) return result
def get_cut_path_open(self, crv): no_entries = self.input_data["entries"] level_depth = self.input_data["depth"] / no_entries sec_plane = self.general_input["sec_plane"] #Lista final de operacion de cortador por curva curves_cut_path = [] for entrie in range(1, int(no_entries) + 1): translation = rs.VectorAdd((0, 0, 0), (0, 0, level_depth * entrie)) level_curve = rs.CopyObject(crv, translation) rs.ObjectColor(level_curve, color_palette["cut"]) if entrie % 2 == 0: rs.ReverseCurve(level_curve) if entrie == 1: entry_end_point = rs.CurveStartPoint(level_curve) in_curve = rs.AddLine( (entry_end_point[0], entry_end_point[1], sec_plane), entry_end_point) rs.ObjectColor(in_curve, color_palette["plunge"]) curves_cut_path.append(in_curve) curves_cut_path.append(level_curve) if entrie < no_entries: level_ept = rs.CurveEndPoint(level_curve) plunge_curve = rs.AddLine(level_ept, (level_ept[0], level_ept[1], (entrie + 1) * level_depth)) rs.ObjectColor(plunge_curve, color_palette["plunge"]) curves_cut_path.append(plunge_curve) final_point = rs.CurveEndPoint(level_curve) out_curve = rs.AddLine(final_point, (final_point[0], final_point[1], sec_plane)) rs.ObjectColor(out_curve, color_palette["cut"]) curves_cut_path.append(out_curve) rs.DeleteObjects([crv]) return curves_cut_path
def dimensionPline(pline, offsetDist): try: if rs.IsCurvePlanar(pline): pass else: print "Curve must be planar" return segments = [] dimGroup = rs.AddGroup("Pline Dims") dir = rs.ClosedCurveOrientation(pline) if dir == -1: rs.ReverseCurve(pline) normal = rs.CurvePlane(pline).ZAxis segments = rs.ExplodeCurves(pline) if len(segments)<1: segments = [rs.CopyObject(pline)] for seg in segments: if rs.IsLine(seg): endPt = rs.CurveEndPoint(seg) stPt = rs.CurveStartPoint(seg) tanVec = rs.VectorCreate(stPt, endPt) offsetVec = rs.VectorRotate(tanVec, 90, normal) offsetVec = rs.VectorUnitize(offsetVec) offsetVec = rs.VectorScale(offsetVec, offsetDist) offsetPt = rs.VectorAdd(stPt, offsetVec) dim = rs.AddAlignedDimension(stPt, endPt, rs.coerce3dpoint(offsetPt), 'PCPA_12') rs.AddObjectToGroup(dim, dimGroup) rs.DeleteObjects(segments) result = True except: result = False return [dimGroup, result]
def Ramp_HeightSlope(path, width, slope): #Variables rampThickness = 6 handrailOffset = 3 handrailRadius = 1.5 handrailHeight = 34 if width < 36: width = 36 width = width + (handrailOffset * 2) comments = '' handrailCenterlineOffset = (handrailOffset - handrailRadius / 2) rs.SimplifyCurve(path) runs = MakeRampRuns(path, width) if slope > .05: runData = CheckRunLengths(runs) runs = runData[0] comments += runData[1] runGeo = [] hdrls = [] finalHandrails = [] vertMove = (0, 0, 0) for run in runs: length = rs.Distance(rs.CurveStartPoint(run[0]), rs.CurveStartPoint(run[1])) stHeight = vertMove vertMove = (0, 0, length * slope) rs.MoveObject(run[-1], vertMove) rs.MoveObjects(run, stHeight) vertMove = rs.VectorAdd(stHeight, vertMove) srf = rs.AddLoftSrf(run) norm = rs.SurfaceNormal(srf[0], [.5, .5]) if norm.Z < 0: rs.FlipSurface(srf[0], True) runGeo.append(srf[0]) else: runGeo.append(srf[0]) hdrls.append(MakeHandrailFromRuns(run, handrailCenterlineOffset)) rs.DeleteObjects(run) #Get highest and lowest lines landingEdges = [] for run in runGeo: curves = rs.DuplicateEdgeCurves(run) highestIndex = None highestValue = -999999 lowestIndex = None lowestValue = 999999 for i, curve in enumerate(curves): crvZ = rs.CurveMidPoint(curve)[2] if crvZ < lowestValue: lowestIndex = i lowestValue = crvZ if crvZ > highestValue: highestIndex = i highestValue = crvZ lowestEdge = rs.CopyObject(curves[lowestIndex]) highestEdge = rs.CopyObject(curves[highestIndex]) landingEdges.append(lowestEdge) rs.ReverseCurve(highestEdge) landingEdges.append(highestEdge) rs.DeleteObjects(curves) comments += 'Total ramp height {}"\n'.format(str(highestValue)) #Make Landings landingGeos = MakeRampLandings(landingEdges, handrailCenterlineOffset) landings = landingGeos[0] hdrls += landingGeos[1] allHandrails = [] for hdrl in hdrls: for each in hdrl: allHandrails.append(each) longRails = rs.JoinCurves(allHandrails, True) #Handrail Extension for rail in longRails: stPt = rs.CurveStartPoint(rail) stVec = rs.CurveTangent(rail, 0) stVecProj = rs.VectorScale( rs.VectorReverse(rs.VectorUnitize((stVec[0], stVec[1], 0))), 12) endPt = rs.CurveEndPoint(rail) endParam = rs.CurveClosestPoint(rail, endPt) endVec = rs.CurveTangent(rail, endParam) endVecProj = rs.VectorScale( rs.VectorUnitize((endVec[0], endVec[1], 0)), 12) stPtTemp = rs.CurveStartPoint(rail) endPtTemp = rs.CurveEndPoint(rail) stPtOffset = rs.MoveObject(stPtTemp, stVecProj) endPtOffset = rs.MoveObject(endPtTemp, endVecProj) stProj = rs.AddLine(stPt, stPtOffset) endProj = rs.AddLine(endPt, endPtOffset) finalHandrails.append(rs.JoinCurves([stProj, rail, endProj], True)[0]) rs.DeleteObject(stPtOffset) rs.DeleteObject(endPtOffset) #Move handrails up for rail in finalHandrails: rs.MoveObject(rail, (0, 0, handrailHeight)) #Make solid geometry topSurface = rs.JoinSurfaces(runGeo + landings, True) if topSurface is None: topSurface = runGeo btmSurface = rs.CopyObject(topSurface, (0, 0, -rampThickness)) edgeCurves = rs.DuplicateSurfaceBorder(topSurface) extrusionLine = rs.AddLine((0, 0, 0), (0, 0, -rampThickness)) extrusionGeo = rs.ExtrudeCurve(edgeCurves, extrusionLine) rs.DeleteObject(extrusionLine) rs.DeleteObject(edgeCurves) finalGeo = rs.JoinSurfaces([topSurface, btmSurface, extrusionGeo], True) #rs.EnableRedraw(True) #print "A" if slope <= .05: rs.DeleteObjects(finalHandrails) return [finalGeo, comments] else: return [finalGeo, comments, finalHandrails]
def loft(self, f, s, t): if not rs.CurveDirectionMatch(f, s): rs.ReverseCurve(s) if not rs.CurveDirectionMatch(s, t): rs.ReverseCurve(t) return rs.AddLoftSrf([f, s, t])
if len(surface)!=1: surface=surfaceToMesh(surface) print surface,type(surface) """ sortedCurves = [] bRing = False if bSquare: length01 = length length12 = length else: length01 = length / 2 length12 = length * 3**0.5 / 2 if len(curves) == 2: # 仅适用于单重曲面 addedCurves = [] if bFlip: rs.ReverseCurve(curves[1]) curve12 = rs.ShortPath(surface, rs.CurveEndPoint(curves[0]), rs.CurveStartPoint(curves[1])) curve30 = rs.ShortPath(surface, rs.CurveEndPoint(curves[1]), rs.CurveStartPoint(curves[0])) sortedCurves = [curves[0], curve12, curves[1], curve30] if len(curves) == 4 or len(curves) == 3: if bSortCurves: sortedCurves = SortCurves(curves) else: sortedCurves = curves if bLength and length: m = round( (rs.CurveLength(sortedCurves[1]) + rs.CurveLength(sortedCurves[3])) / length12 / 2) - 1 n = round(
y3 = random.randint(0,50) z3 = random.randint(0,50) x4 = random.randint(0,50) y4 = random.randint(0,50) z4 = random.randint(0,50) p1 = rs.AddPoint(x1,y1,0) p2 = rs.AddPoint(x2,0,z2) p3 = rs.AddPoint(0,y3,z3) p4 = rs.AddPoint(x4,y4,50) p5 = rs.AddPoint(x4,50,z4) p6 = rs.AddPoint(50,y4,z4) A = rs.AddInterpCurve([a,p3,b],3,0,None,None) B = rs.AddInterpCurve([b,p4,c],3,0,None,None) C = rs.AddInterpCurve([c,p6,d],3,0,None,None) D = rs.AddInterpCurve([d,p1,a],3,0,None,None) rs.ReverseCurve(B) rs.ReverseCurve(D) rs.AddLoftSrf([A,B],None,None,0,0,0,False) rs.AddLoftSrf([C,B],None,None,0,0,0,False) rs.AddLoftSrf([C,D],None,None,0,0,0,False) rs.AddLoftSrf([A,D],None,None,0,0,0,False) #
def Cargas_Shed(viga, plD, plB, plC, cob, borda1, borda2, conv): rs.ReverseCurve(cob) cob = rs.coercecurve(cob) forces = [] #separando entrada viga em seus elementos (polilinhas) #bs = banzo superior, diag = diagonais, bi = banzo inferior bs, diag, bi = viga #extraindo os nós do banzo superior nos = rs.PolylineVertices(bs) # explodindo polilinhas bs = rs.ExplodeCurves(bs) diag = rs.ExplodeCurves(diag) bi = rs.ExplodeCurves(bi) for i in range(len(nos)): P = 0 if 0 < i < (len(nos) - 1): #banzo inferior P = rs.CurveLength(bi[i - 1]) * plB #banzo superior P += (rs.CurveLength(bs[i - 1]) + rs.CurveLength(bs[i])) / 2 * plB #diagonais P += (rs.CurveLength(diag[i * 2]) + rs.CurveLength(diag[(i * 2) - 1])) * plD #cobertura bs1 = bs[i - 1] bs1 = rs.coerceline(bs1) ptAux1 = bs1.PointAt(.5) bs2 = bs[i] bs2 = rs.coerceline(bs2) ptAux2 = bs2.PointAt(.5) param1 = rs.CurveClosestPoint(cob, ptAux1) param2 = rs.CurveClosestPoint(cob, ptAux2) elif i == 0: #banzo superior P += (rs.CurveLength(bs[i]) / 2) * plB #diagonal P += (rs.CurveLength(diag[i * 2])) * plD #cobertura param1 = 0 bs1 = bs[i] bs1 = rs.coerceline(bs1) ptAux = bs1.PointAt(.5) param2 = rs.CurveClosestPoint(cob, ptAux) elif i == (len(nos) - 1): #banzo superior e conector P = (rs.CurveLength(bs[-1]) / 2 + rs.CurveLength(borda1)) * plB #eixo do conector P += rs.CurveLength(borda2) * plB #cobertura bs1 = bs[i - 1] bs1 = rs.coerceline(bs1) ptAux1 = bs1.PointAt(.5) borda1 = rs.coerceline(borda1) ptAux2 = borda1.PointAt(.5) param1 = rs.CurveClosestPoint(cob, ptAux1) param2 = rs.CurveClosestPoint(cob, ptAux2) if len(diag) % 2 == 0: #banzo inferior P += rs.CurveLength(bi[i - 1]) * plB #diagonal P += (rs.CurveLength(diag[(i * 2) - 1])) * plD P_viga = P if not param1 == param2: cobAux = rs.TrimCurve(cob, [param1, param2], False) P_cob = rs.CurveLength(cobAux) * plC P += P_cob P *= conv forces.append(P) return forces, P_viga, P_cob
N_Tr = 1 if not Plano: Plano = rs.WorldXYPlane() #decompoe o plano de trabalho nos componentes Origem e os eixos xyz pOr, eX, eY, eZ = Plano #Separando os eixos em listas #conector Conector = Eixos[-2:] #vigas v1 = Eixos[:3] v2 = Eixos[3:6] v3 = Eixos[6:9] #invertendo sentido da viga v3 rs.ReverseCurve(v3[0]) rs.ReverseCurve(v3[1]) rs.ReverseCurve(v3[2]) #diagonais Diagonais = [v1[1], v2[1], v3[1]] #banzos Banzo_Sup = [v1[0], v2[0], v3[0]] Banzo_Inf = [v1[2], v2[2], v3[2]] #apoios Apoios = [rs.CurveStartPoint(v1[2]), rs.CurveStartPoint(v2[2])] #Eixo de Simetria do conector EixoSimetria = Conector[0] EixoSimetria = rs.coerceline(EixoSimetria) def Volumetria(eixos, dist_e, dist_l, pto):
def TurbofanNacelle(EngineSection, Chord, CentreLocation=[0, 0, 0], ScarfAngle=3, HighlightRadius=1.45, MeanNacelleLength=5.67): # The defaults yield a nacelle similar to that of an RR Trent 1000 / GEnx HighlightDepth = 0.12 * MeanNacelleLength SectionNo = 100 # Draw the nacelle with the centre of the intake highlight circle in 0,0,0 rs.EnableRedraw(False) Highlight = rs.AddCircle3Pt((0, 0, HighlightRadius), (0, -HighlightRadius, 0), (0, 0, -HighlightRadius)) HighlightCutterCircle = rs.AddCircle3Pt((0, 0, HighlightRadius * 1.5), (0, -HighlightRadius * 1.5, 0), (0, 0, -HighlightRadius * 1.5)) # Fan disk for CFD boundary conditions FanCircle = rs.CopyObject(Highlight, (MeanNacelleLength * 0.25, 0, 0)) FanDisk = rs.AddPlanarSrf(FanCircle) # Aft outflow for CFD boundary conditions BypassCircle = rs.CopyObject(Highlight, (MeanNacelleLength * 0.85, 0, 0)) BypassDisk = rs.AddPlanarSrf(BypassCircle) rs.DeleteObjects([FanCircle, BypassCircle]) # Outflow cone TailConeBasePoint = [MeanNacelleLength * 0.84, 0, 0] TailConeApex = [MeanNacelleLength * 1.35, 0, 0] TailConeRadius = HighlightRadius * 0.782 TailCone = rs.AddCone(TailConeBasePoint, TailConeApex, TailConeRadius) # Spinner cone SpinnerConeBasePoint = [MeanNacelleLength * 0.26, 0, 0] SpinnerConeApex = [MeanNacelleLength * 0.08, 0, 0] SpinnerConeRadius = MeanNacelleLength * 0.09 Spinner = rs.AddCone(SpinnerConeBasePoint, SpinnerConeApex, SpinnerConeRadius) # Tilt the intake RotVec = rs.VectorCreate((0, 0, 0), (0, 1, 0)) Highlight = rs.RotateObject(Highlight, (0, 0, 0), ScarfAngle, axis=RotVec) # Set up the disk for separating the intake lip later HighlightCutterCircle = rs.RotateObject(HighlightCutterCircle, (0, 0, 0), ScarfAngle, axis=RotVec) HighlightCutterDisk = rs.AddPlanarSrf(HighlightCutterCircle) rs.DeleteObject(HighlightCutterCircle) rs.MoveObject(HighlightCutterDisk, (HighlightDepth, 0, 0)) # Build the actual airfoil sections to define the nacelle HighlightPointVector = rs.DivideCurve(Highlight, SectionNo) Sections = [] TailPoints = [] Rotation = 0 Twist = 0 AirfoilSeligName = 'goe613' SmoothingPasses = 1 for HighlightPoint in HighlightPointVector: ChordLength = MeanNacelleLength - HighlightPoint.X Af = primitives.Airfoil(HighlightPoint, ChordLength, Rotation, Twist, airconics_setup.SeligPath) AfCurve, Chrd = primitives.Airfoil.AddAirfoilFromSeligFile( Af, AirfoilSeligName, SmoothingPasses) rs.DeleteObject(Chrd) P = rs.CurveEndPoint(AfCurve) list.append(TailPoints, P) AfCurve = act.AddTEtoOpenAirfoil(AfCurve) list.append(Sections, AfCurve) Rotation = Rotation + 360.0 / SectionNo list.append(TailPoints, TailPoints[0]) # Build the actual nacelle OML surface EndCircle = rs.AddInterpCurve(TailPoints) Nacelle = rs.AddSweep2([Highlight, EndCircle], Sections, closed=True) # Separate the lip Cowling, HighlightSection = rs.SplitBrep(Nacelle, HighlightCutterDisk, True) # Now build the pylon between the engine and the specified chord on the wing CP1 = [ MeanNacelleLength * 0.26 + CentreLocation[0], CentreLocation[1], CentreLocation[2] + HighlightRadius * 0.1 ] CP2 = [ MeanNacelleLength * 0.4 + CentreLocation[0], CentreLocation[1], HighlightRadius * 1.45 + CentreLocation[2] ] CP3 = rs.CurveEndPoint(Chord) rs.ReverseCurve(Chord) CP4 = rs.CurveEndPoint(Chord) # Move the engine into its actual place on the wing rs.MoveObjects( [HighlightSection, Cowling, FanDisk, BypassDisk, TailCone, Spinner], CentreLocation) # Pylon wireframe PylonTop = rs.AddInterpCurve([CP1, CP2, CP3, CP4]) PylonAf = primitives.Airfoil(CP1, MeanNacelleLength * 1.35, 90, 0, airconics_setup.SeligPath) PylonAfCurve, PylonChord = primitives.Airfoil.AddNACA4( PylonAf, 0, 0, 12, 3) LowerTE = rs.CurveEndPoint(PylonChord) PylonTE = rs.AddLine(LowerTE, CP4) # Create the actual pylon surface PylonLeft = rs.AddNetworkSrf([PylonTop, PylonAfCurve, PylonTE]) rs.MoveObject(PylonLeft, (0, -CentreLocation[1], 0)) PylonRight = act.MirrorObjectXZ(PylonLeft) rs.MoveObject(PylonLeft, (0, CentreLocation[1], 0)) rs.MoveObject(PylonRight, (0, CentreLocation[1], 0)) PylonAfCurve = act.AddTEtoOpenAirfoil(PylonAfCurve) PylonAfSrf = rs.AddPlanarSrf(PylonAfCurve) # Assigning basic surface properties act.AssignMaterial(Cowling, "ShinyBABlueMetal") act.AssignMaterial(HighlightSection, "UnpaintedMetal") act.AssignMaterial(TailCone, "UnpaintedMetal") act.AssignMaterial(FanDisk, "FanDisk") act.AssignMaterial(Spinner, "ShinyBlack") act.AssignMaterial(BypassDisk, "FanDisk") act.AssignMaterial(PylonLeft, "White_composite_external") act.AssignMaterial(PylonRight, "White_composite_external") # Clean-up rs.DeleteObject(HighlightCutterDisk) rs.DeleteObjects(Sections) rs.DeleteObject(EndCircle) rs.DeleteObject(Highlight) rs.DeleteObjects([PylonTop, PylonAfCurve, PylonChord, PylonTE]) rs.Redraw() TFEngine = [ Cowling, HighlightSection, TailCone, FanDisk, Spinner, BypassDisk ] TFPylon = [PylonLeft, PylonRight, PylonAfSrf] return TFEngine, TFPylon
def Linha_force_extena(no, peso, conv): lincarg = rs.AddLine(no, gh.Move(no, peso * conv * eY)[0]) rs.ReverseCurve(lincarg) return lincarg
p_txt = RAFG.PointAt(.5) carga1 = rs.CurveLength(RA) * 1 / Escala texto = 'RA = ' + str('%.2f' % carga1) txt_pontos += [p_txt, texto, corcargas] FG1.append(rs.coerceline(RAFG)) # - desenhando reação RB no FG vAux2 = rs.AddLine(rs.CurveStartPoint(RB), nbs3[0]) RBFG = gh.Move(rs.coerceline(RB), rs.coerceline(vAux2))[0] p_txt = RBFG.PointAt(.5) carga2 = rs.CurveLength(RB) - 1 / Escala texto = 'RB = ' + str('%.2f' % carga2) txt_pontos += [p_txt, texto, corcargas] FG1.append(rs.coerceline(RBFG)) # - tensão em bi3[0] bi0PF = rs.CopyObjects(RA) rs.ReverseCurve(bi0PF) bi0PF = rs.coerceline(bi0PF) #dicionario dic_1['bi0_v3'] = bi0PF #textos carga1 = -1 * carga1 cor1 = teste_elemento(texto, carga1, bi3[0]) p_txt = rs.coerceline(bi0PF).PointAt(.75) txt_pontos += [p_txt, 'bi0_v3', cor1] p_txt = rs.coerceline(bi3[0]).PointAt(.5) texto = 'bi0_v3 = ' + str('%.2f' % (carga1)) txt_pontos += [p_txt, texto, cor1] #carregamento no nó[0] carreg_1.insert(0, RB) #coloca nomenclatura do elemento na lista de elementos comprimidos Lcomp.append('bi0_v3')