![]() With a face selected click the “Create a New Sketch” tool in the Sketcher Toolbar. Msg = anslate("Data saved at '" + self.dataFile + "'.The process of adding a Sketch is very straight-forward. String = "%f %f %f %f %f %f %f %f %f %f %f\n" % (point.disp, point.draft, point.wet, point.mom, point.xcb, point.farea, point.KBt, point.BMt, point.Cb, point.Cf, point.Cm) Point = Tools.Point(ship,faces,draft,trim) Msg = anslate("Can't detect external faces from ship object.\n")į("Computing hydrostatics.\n")į("\t%d / %d\n" % (i+1, len(drafts))) Output.write(" # 11: Cm (Main frame coefficient)\n") Output.write(" # 10: Cf (Floating coefficient)\n") Output.write(" # 9: Cb (block coefficient)\n") Output.write(" # 5: Bouyance center x coordinate\n") Output.write(" # 4: 1cm triming ship moment \n") Output.write(" # 1: Ship displacement \n") ![]() Output.write(" # This file contains transversal areas data, filled with following columns:\n") Output.write(" # File automatically exported by FreeCAD-Ship\n") Msg = anslate("Can't write '" + filename + "' file.\n") """ Write data ship Selected ship trim Trim in drafts List of drafts to be True if error happens.įilename = self.path + 'hydrostatics.dat' Pocket = obj.newObject(_featureClassMapping, "bottomCurvePocket") Sketcher.Constraint("DistanceY", -1, -1, 1, 2, bottomEdgeY)) (curveRadius, bottomEdgeY), (curveRadius, centerY)]īottomSketch.addConstraint(Sketcher.Constraint("Vertical", 1))īottomSketch.addConstraint(Sketcher.Constraint("Horizontal", 2))īottomSketch.addConstraint(Sketcher.Constraint("Vertical", 3))īottomSketch.addConstraint(Sketcher.Constraint("Coincident", *p)) Points = [(-curveRadius, centerY), (-curveRadius, bottomEdgeY), M = dc.model.fillet_edges_longer_than(m, d, 150)ĭef _cutBottomCurve(doc, obj, length, curveRadius):īottomSketch = obj.newObject(_featureClassMapping,īottomSketch.Support = (doc.YZ_Plane, '')ĬurveRadius), -math.pi, 0), False) # (in radian)īottomSketch.addConstraint(Sketcher.Constraint('Radius', 0, curveRadius)) Insert = dc.model.fillet_edges_by_length(insert, d,īase.Vector(-d / 2, -d / 2, 0)) Pocket = obj.newObject(_featureClassMapping, "topCurvePocket") Sketcher.Constraint("DistanceY", -1, -1, 1, 2, topEdgeY)) Sketcher.Constraint("DistanceY", -1, 1, 0, 3, centerY)) TopSketch.addConstraint(Sketcher.Constraint("Coincident", *p)) TopSketch.addConstraint(Sketcher.Constraint("Horizontal", 2)) TopSketch.addConstraint(Sketcher.Constraint("Vertical", 1)) (-curveRadius, topEdgeY), (-curveRadius, centerY)) ![]() Points = ((curveRadius, centerY), (curveRadius, topEdgeY), TopSketch.addConstraint(Sketcher.Constraint('Radius', 0, curveRadius)) Part.Circle(App.Vector(0, centerY, 0), App.Vector(0, 0, 1),ĬurveRadius), 0, math.pi), False) # (in radian) TopSketch = obj.newObject(_featureClassMapping, "topSketch") TopCurvePlane.AttachmentOffset = App.Placement(Īpp.Rotation(0, grees(orientationBF),Ġ) # Yaw = x, Pitch = z, Roll = y (in deg) TopCurvePlane = obj.newObject(_featureClassMapping, M.translate(Base.Vector(0, 0, -d))ĭef _cutTopCurve(doc, obj, length, orientationBF, curveRadius): M = dc.model.fillet_edges_longer_than(m, d, 300) Insert_1 = dc.model.fillet_edges_by_length(insert_1, M = dc.model.fillet_edges_by_length(m, 35, d) If faceBounds.XMax - faceBounds.XMin > 0.00001:Īpp.ActiveDocument.removeObject() # Divide by faces and compute only section placed ones ![]() # computed desired data we can remove it. # Recompute object adding it to the scene, when we have # Now we need to know the x range of values # We will take a duplicate of ship shape in order to place it ![]() """ Calculate main frame ship Selected ship draft Main frame coefficient ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |