From 351c1b9264c7d8422b0dea021a88c01b3975a9c1 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Tue, 23 Oct 2018 07:43:21 -0400 Subject: [PATCH 1/2] Misc. typos Found via `codespell -q 3 -L ang,cas,vertexes` --- CommandsPolar.py | 2 +- README.md | 6 ++--- examples/board6.brd | 2 +- frameCmd.py | 28 ++++++++++++------------ pipeCmd.py | 2 +- pipeFeatures.py | 53 ++++++++++++++++++++++----------------------- pipeForms.py | 2 +- 7 files changed, 47 insertions(+), 48 deletions(-) diff --git a/CommandsPolar.py b/CommandsPolar.py index 07bc758..57171d2 100644 --- a/CommandsPolar.py +++ b/CommandsPolar.py @@ -137,7 +137,7 @@ def Activated(self): FreeCADGui.Control.showDialog(fe_ChEDL.dpCalcDialog()) def GetResources(self): - return{'Pixmap':os.path.join(os.path.dirname(os.path.abspath(__file__)),"icons","delta.svg"),'MenuText':'Pressure loss calculator','ToolTip':'Calculate pressure loss in "pypes" using ChEDL libraries.\n See __doc__ of the module for futher information.'} + return{'Pixmap':os.path.join(os.path.dirname(os.path.abspath(__file__)),"icons","delta.svg"),'MenuText':'Pressure loss calculator','ToolTip':'Calculate pressure loss in "pypes" using ChEDL libraries.\n See __doc__ of the module for further information.'} class selectSolids: diff --git a/README.md b/README.md index f2a694b..1d148a8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ For convenience Flamingo tools are grouped in three toolbars/menus + one utility ![screenshot1](https://www.freecadweb.org/wiki/images/9/9e/Flamingos_frame2.jpg) It's a simple toolbox of 12 commands to arrange frames, trusses and similar to using the Structure objects in FreeCAD's Arch module. -Read [tutorialFrame.pdf](https://github.com/oddtopus/flamingo/blob/master/tutorials/tutorialFrame.pdf) for more informations. Code is in `CommandsFrame.py` +Read [tutorialFrame.pdf](https://github.com/oddtopus/flamingo/blob/master/tutorials/tutorialFrame.pdf) for more information. Code is in `CommandsFrame.py` ### PypeTools toolbar ![screenshot1](https://www.freecadweb.org/wiki/images/0/06/Flamingos_pype2.jpg) @@ -23,11 +23,11 @@ The logical continuation of the frame tool since it deals with creating pipeline Read [tutorialPype2.pdf](https://github.com/oddtopus/flamingo/blob/master/tutorials/tutorialPype2.pdf) for more specific features. Code is in `CommandsPipe.py` ### EagleTools toolbar -This toolbar is mantained only for historical reasons. "Eagle tools": are basically an addition and shortcut to the very fine [FreeCAD-PCB workbench](https://github.com/marmni/FreeCAD-PCB) (available via the [FreeCAD addon manager](https://github.com/FreeCAD/FreeCAD-addons)) to import position of objects from a .brd Eagle's file on a PCB drawn in FreeCAD with the a.m. workbench relating only on their names. It's also the origin, by extension, of the name of the entire workbench. +This toolbar is maintained only for historical reasons. "Eagle tools": are basically an addition and shortcut to the very fine [FreeCAD-PCB workbench](https://github.com/marmni/FreeCAD-PCB) (available via the [FreeCAD addon manager](https://github.com/FreeCAD/FreeCAD-addons)) to import position of objects from a .brd Eagle's file on a PCB drawn in FreeCAD with the a.m. workbench relating only on their names. It's also the origin, by extension, of the name of the entire workbench. > "If the parts in the group Parts of the .FCStd file have the same name of the parts in the .brd file, they will be moved to the position of the PCB specified in the .brd file." -Read [tutorialEagle.pdf](https://github.com/oddtopus/flamingo/blob/master/tutorials/tutorialEagle.pdf) for more informations. Code is in `CommandsEagle.py` +Read [tutorialEagle.pdf](https://github.com/oddtopus/flamingo/blob/master/tutorials/tutorialEagle.pdf) for more information. Code is in `CommandsEagle.py` ### Utils toolbar ![screenshot1](https://www.freecadweb.org/wiki/images/d/d2/Flamingos_utils.jpg) diff --git a/examples/board6.brd b/examples/board6.brd index 0cdadaa..c6b2ea2 100644 --- a/examples/board6.brd +++ b/examples/board6.brd @@ -1640,7 +1640,7 @@ Extended by Federico Battaglin <author>&lt;federico.rd@fdpinternationa <b>Opto Couplers</b><p> -Siemens, Hewlett-Packard, Texas Instuments, Sharp, Motorola<p> +Siemens, Hewlett-Packard, Texas Instruments, Sharp, Motorola<p> <author>Created by librarian@cadsoft.de</author> diff --git a/frameCmd.py b/frameCmd.py index f0c7cc8..9743dfd 100644 --- a/frameCmd.py +++ b/frameCmd.py @@ -92,21 +92,21 @@ def intersectionCLines(thing1=None, thing2=None): else: FreeCAD.Console.PrintError('No intersection found\n') return None - + def intersectionLines(p1=None,v1=None,p2=None,v2=None): # OBSOLETE: replaced with intersectionCLines ''' intersectionLines(p1,v1,p2,v2) - If exist, returns the intersection (vector) between two lines + If exist, returns the intersection (vector) between two lines p1,v1: the reference point and direction of first line p2,v2: the reference point and direction of second line ''' - + if None in [p1,p2,v1,v2]: eds=edges()[:2] p1,p2=[e.valueAt(0) for e in eds] v1,v2=[e.tangentAt(0) for e in eds] - if not isParallel(v1,v2): + if not isParallel(v1,v2): dist=p1-p2 import numpy #M=numpy.matrix([list(v1),list(v2),list(dist)]) # does not work: it seems for lack of accuracy of FreeCAD.Base.Vector operations! @@ -114,7 +114,7 @@ def intersectionLines(p1=None,v1=None,p2=None,v2=None): # OBSOLETE: replaced wit rowM2=[round(x,2) for x in v2] rowM3=[round(x,2) for x in dist] M=numpy.matrix([rowM1,rowM2,rowM3]) - if numpy.linalg.det(M)==0: + if numpy.linalg.det(M)==0: #3 equations, 2 unknowns => 1 eq. must be dependent a11,a21,a31=list(v1) a12,a22,a32=list(v2*-1) @@ -146,7 +146,7 @@ def intersectionPlane(base=None,v=None,face=None): base (vector): the base point to be projected v (vector): the direction of the line that intersect the plane face (Face): the face that defines the plane to be intersect - ''' + ''' # only for quick testing: if base==v==face==None: face = faces()[0] @@ -219,7 +219,7 @@ def beamAx(beam, vShapeRef=None): return beam.Placement.Rotation.multVec(vShapeRef).normalize() def getDistance(shapes=None): - 'measure the lenght of an edge or the distance of two shapes' + 'measure the length of an edge or the distance of two shapes' if not shapes: shapes=[y for x in FreeCADGui.Selection.getSelectionEx() for y in x.SubObjects if hasattr(y,'ShapeType')] if len(shapes)==1 and shapes[0].ShapeType=='Edge': @@ -245,7 +245,7 @@ def bisect(w1=None,w2=None): for i in range(3): b[i]=(w1[i]+w2[i])/2 return b.normalize() - + def ortho(w1=None,w2=None): ''' ortho(w1=None,w2=None) @@ -280,7 +280,7 @@ def edgeName(obj=None,edge=None): return obj,"Edge"+str(i) i+=1 return None - + ############ COMMANDS ############# def spinTheBeam(beam, angle): # OBSOLETE: replaced by rotateTheTubeAx @@ -340,7 +340,7 @@ def pivotTheBeam(ang=90, edge=None, beam=None): #OBSOLETE: replaced with rotateT edgePost=edges()[0] #save position for revert dist=edge.CenterOfMass-edgePost.CenterOfMass beam.Placement.move(dist) - + def rotateTheBeamAround(b,e,ang=90): # for rotation around an axis ''' rotateTheBeamAround(b,e,ang=90): rotates any Body around an edge @@ -355,11 +355,11 @@ def rotateTheBeamAround(b,e,ang=90): # for rotation around an axis P1=O+rot.multVec(P0.Point-O) b.Placement.Rotation=rot.multiply(b.Placement.Rotation) b.Placement.Base=P1 #rot.multVec(b.Placement.Base) - + def stretchTheBeam(beam,L): if beam!=None and beam.TypeId=="Part::FeaturePython" and hasattr(beam,"Height"): beam.Height=L - + def extendTheBeam(beam,target): '''arg1=beam, arg2=target: extend the beam to a plane, normal to its axis, defined by target. If target is a Vertex or a Vector, the plane is the one that includes the point defined by target. @@ -390,7 +390,7 @@ def extendTheBeam(beam,target): beam.Height+=FreeCAD.Units.Quantity(str(abs(distTop))+"mm") else: beam.Height+=FreeCAD.Units.Quantity(str(abs(distBase))+"mm") - vMove=vBeam.normalize().multiply(-distBase) + vMove=vBeam.normalize().multiply(-distBase) beam.Placement.move(vMove) else: if abs(distBase)>abs(distTop): @@ -400,7 +400,7 @@ def extendTheBeam(beam,target): vMove=vBeam.normalize().multiply(-distBase) beam.Placement.move(vMove) #FreeCAD.activeDocument().recompute() - + def rotjoinTheBeam(beam=None,e1=None,e2=None): if not (beam and e1 and e2): beam=beams()[1] diff --git a/pipeCmd.py b/pipeCmd.py index 9f35f1b..cb2a585 100644 --- a/pipeCmd.py +++ b/pipeCmd.py @@ -736,7 +736,7 @@ def getElbowPort(elbow, portId=0): def rotateTheElbowPort(curve=None, port=0, ang=45): ''' rotateTheElbowPort(curve=None, port=0, ang=45) - Rotates one curve aroud one of its circular edges. + Rotates one curve around one of its circular edges. ''' if curve==None: try: diff --git a/pipeFeatures.py b/pipeFeatures.py index 4bcedf4..b0db1ec 100644 --- a/pipeFeatures.py +++ b/pipeFeatures.py @@ -34,7 +34,7 @@ def execute(self, fp): def nearestPort (self,point=None): ''' nearestPort (point=None) - Returns the Port nearest to point + Returns the Port nearest to point or to the selected geometry. (, , ) ''' @@ -155,7 +155,7 @@ def execute(self, fp): else: fp.Shape=sol super(Elbow,self).execute(fp) # perform common operations - + class Flange(pypeType): '''Class for object PType="Flange" Flange(obj,[PSize="DN50",FlangeType="SO", D=160, d=60.3,df=132, f=14 t=15,n=4, trf=0, drf=0, twn=0, dwn=0, ODp=0]) @@ -250,7 +250,7 @@ def __init__(self, obj,DN="DN50",OD=60.3,OD2=48.3,thk=3, thk2=None, H=None, conc obj.thk2=thk else: obj.thk2=thk2 - obj.addProperty("App::PropertyBool","calcH","Reduct","Make the lenght variable") + obj.addProperty("App::PropertyBool","calcH","Reduct","Make the length variable") obj.addProperty("App::PropertyLength","Height","Reduct","Length of reduct") if not H: obj.calcH=True @@ -288,7 +288,7 @@ def execute(self, fp): fp.Shape=sol fp.Ports=[FreeCAD.Vector(),FreeCAD.Vector((fp.OD-fp.OD2)/2,0,float(fp.Height))] super(Reduct,self).execute(fp) # perform common operations - + class Cap(pypeType): '''Class for object PType="Cap" Cap(obj,[PSize="DN50",OD=60.3,thk=3]) @@ -326,25 +326,25 @@ def execute(self, fp): fp.Shape = cap fp.Ports=[FreeCAD.Vector()] super(Cap,self).execute(fp) # perform common operations - + class PypeLine2(pypeType): '''Class for object PType="PypeLine2" - This object represent a collection of objects "PType" that are updated with the + This object represent a collection of objects "PType" that are updated with the methods defined in the Python class. - At present time it creates, with the method obj.Proxy.update(,obj,[edges]), pipes and curves over + At present time it creates, with the method obj.Proxy.update(,obj,[edges]), pipes and curves over the given edges and collect them in a group named according the object's .Label. PypeLine2 features also the optional attribute ".Base": - Base can be a Wire or a Sketch or any object which has edges in its Shape. - - Running "obj.Proxy.update(obj)", without any [edges], the class attempts to render the pypeline - (Pipe and Elbow objects) on the "obj.Base" edges: for well defined geometries + - Running "obj.Proxy.update(obj)", without any [edges], the class attempts to render the pypeline + (Pipe and Elbow objects) on the "obj.Base" edges: for well defined geometries and open paths, this usually leads to acceptable results. - - Running "obj.Proxy.purge(obj)" deletes from the model all Pipes and Elbows - that belongs to the pype-line. - - It's possible to add other objects afterwards (such as Flange, Reduct...) - using the relevant insertion dialogs but remember that these won't be updated + - Running "obj.Proxy.purge(obj)" deletes from the model all Pipes and Elbows + that belongs to the pype-line. + - It's possible to add other objects afterwards (such as Flange, Reduct...) + using the relevant insertion dialogs but remember that these won't be updated when the .Base is changed and won't be deleted if the pype-line is purged. - - If Base is None, PypeLine2 behaves like a bare container of objects, - with possibility to group them automatically and extract the part-list. + - If Base is None, PypeLine2 behaves like a bare container of objects, + with possibility to group them automatically and extract the part-list. ''' def __init__(self, obj,DN="DN50",PRating="SCH-STD",OD=60.3,thk=3,BR=None, lab=None): # initialize the parent class @@ -469,8 +469,8 @@ def __init__(self,obj,L=800,W=400,H=500,thk1=6, thk2=8): obj.addProperty("App::PropertyLength","L","Tank","Tank's length").L=L obj.addProperty("App::PropertyLength","W","Tank","Tank's width").W=W obj.addProperty("App::PropertyLength","H","Tank","Tank's height").H=H - obj.addProperty("App::PropertyLength","thk1","Tank","Thikness of tank's shell").thk1=thk1 - obj.addProperty("App::PropertyLength","thk2","Tank","Thikness of tank's top").thk2=thk2 + obj.addProperty("App::PropertyLength","thk1","Tank","Thickness of tank's shell").thk1=thk1 + obj.addProperty("App::PropertyLength","thk2","Tank","Thickness of tank's top").thk2=thk2 def onChanged(self, fp, prop): return None def execute(self, fp): @@ -546,7 +546,7 @@ def execute(self, fp): fp.Shape = v fp.Ports=[FreeCAD.Vector(),FreeCAD.Vector(0,0,float(fp.Height))] super(Valve,self).execute(fp) # perform common operations - + class PypeBranch2(pypeType): # use AttachExtensionPython '''Class for object PType="PypeBranch2" Single-line pipe branch linked to its center-line using AttachExtensionPython @@ -570,7 +570,7 @@ def __init__(self, obj,base,DN="DN50",PRating="SCH-STD",OD=60.3,thk=3,BR=None): obj.addProperty("App::PropertyStringList","Tubes","PypeBranch","The tubes of the branch.") obj.addProperty("App::PropertyStringList","Curves","PypeBranch","The curves of the branch.") obj.addProperty("App::PropertyLink","Base","PypeBranch","The path.") - if hasattr(base,"Shape") and base.Shape.Edges: + if hasattr(base,"Shape") and base.Shape.Edges: obj.Base=base else: FreeCAD.Console.PrintError('Base not valid\n') @@ -605,18 +605,18 @@ def execute(self, fp): if i0: + if i>0: alfa=e.tangentAt(0).getAngle(fp.Base.Shape.Edges[i-1].tangentAt(0))/2 L-=R*tan(alfa) offset=R*tan(alfa) - if i<(len(fp.Base.Shape.Edges)-1): + if i<(len(fp.Base.Shape.Edges)-1): alfa=e.tangentAt(0).getAngle(fp.Base.Shape.Edges[i+1].tangentAt(0))/2 L-=R*tan(alfa) eSupport='Edge'+str(i+1) @@ -668,4 +668,3 @@ def purge(self,fp): fp.removeObjects([FreeCAD.ActiveDocument.getObject(name) for name in fp.Curves]) for name in fp.Curves: FreeCAD.ActiveDocument.removeObject(name) fp.Curves=[] - diff --git a/pipeForms.py b/pipeForms.py index 1a7c3d3..d04d074 100644 --- a/pipeForms.py +++ b/pipeForms.py @@ -754,7 +754,7 @@ class insertUboltForm(protopypeForm): For position and orientation you can select - one or more circular edges, - nothing. - In case one pipe is selected, its properties are aplied to the U-bolt. + In case one pipe is selected, its properties are applied to the U-bolt. Available one button to reverse the orientation of the last or selected tubes. ''' def __init__(self): From 42cbe6955bb9041234e66fd6d96067f098750a77 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Mon, 19 Aug 2019 09:30:44 -0400 Subject: [PATCH 2/2] more typos --- examples/board6.brd | 2 +- pipeFeatures.py | 4 ++-- polarUtilsCmd.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/board6.brd b/examples/board6.brd index c6b2ea2..1c75bc4 100644 --- a/examples/board6.brd +++ b/examples/board6.brd @@ -448,7 +448,7 @@ www.panasonic.com<p> www.kemet.com<p> http://www.secc.co.jp/pdf/os_e/2004/e_os_all.pdf <b>(SANYO)</b> <p> -for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> +for trimmer reference see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> <table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0> <tr valign="top"> diff --git a/pipeFeatures.py b/pipeFeatures.py index b0db1ec..96ed57b 100644 --- a/pipeFeatures.py +++ b/pipeFeatures.py @@ -168,9 +168,9 @@ class Flange(pypeType): f (float): bolts holes diameter t (float): flange thickness n (int): nr. of bolts - trf (float): raised-face thikness + trf (float): raised-face thickness drf (float): raised-face diameter - twn (float): welding-neck thikness + twn (float): welding-neck thickness dwn (float): welding-neck diameter ODp (float): outside diameter of pipe for wn flanges ''' diff --git a/polarUtilsCmd.py b/polarUtilsCmd.py index a3f2ef5..425ad9b 100644 --- a/polarUtilsCmd.py +++ b/polarUtilsCmd.py @@ -12,7 +12,7 @@ from frameForms import prototypeDialog def cerchio(R=1, nseg=8): - 'arg1=R, arg2=nseg: returns a list of 3-uple for nseg+1 coordintates on the semi-circle centered in (0,0,0)' + 'arg1=R, arg2=nseg: returns a list of 3-uple for nseg+1 coordinates on the semi-circle centered in (0,0,0)' teta=[i*2*math.pi/nseg for i in range(nseg+1)] return [polar2xy(R,t) for t in teta]