diff --git a/Gui/Resources/icons/constraints/Assembly_ConstraintColinear.svg b/Gui/Resources/icons/constraints/Assembly_ConstraintColinear.svg new file mode 100644 index 0000000..76e840e --- /dev/null +++ b/Gui/Resources/icons/constraints/Assembly_ConstraintColinear.svg @@ -0,0 +1,642 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + [jmaustpc] + + + Assembly_ConstraintParallel + 2013-12-24 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Assembly/Gui/Resources/icons/constraints/Assembly_ConstraintParallel.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + + + + + + + + + diff --git a/constraint.py b/constraint.py index 787c736..b784168 100644 --- a/constraint.py +++ b/constraint.py @@ -185,6 +185,10 @@ def _l(solver,partInfo,subname,shape,retAll=False): return h if retAll else h[0] +def _la(solver,partInfo,subname,shape,retAll=False): + _ = retAll + return _l(solver,partInfo,subname,shape,True) + def _dl(solver,partInfo,subname,shape,retAll=False): 'return a handle of a draft wire' if not solver: @@ -907,8 +911,8 @@ class MultiParallel(BaseMulti): _entityDef = (_ln,) _iconName = 'Assembly_ConstraintMultiParallel.svg' _props = ['LockAngle','Angle'] - _tooltip = 'Add a "{}" constraint to make planes or linear edges of two\n'\ - 'or more parts parallel.' + _tooltip = 'Add a "{}" constraint to make planes normal or linear edges\n'\ + 'of two or more parts parallel.' class Base2(Base): @@ -1110,6 +1114,13 @@ class ArcLineTangent(Base2): _tooltip='Add a "{}" constraint to make a line tangent to an arc\n'\ 'at the start or end point of the arc.' +class Colinear(Base2): + _id = 38 + _entityDef = (_la, _l) + _workplane = True + _iconName = 'Assembly_ConstraintColinear.svg' + _tooltip='Add a "{}" constraint to make to line colinear' + class BaseSketch(Base): _id = -1 @@ -1117,7 +1128,7 @@ class BaseSketch(Base): class SketchPlane(BaseSketch): - _id = 38 + _id = 39 _iconName = 'Assembly_ConstraintSketchPlane.svg' _tooltip='Add a "{0}" to define the work plane of any draft element\n'\ 'inside or following this constraint. Add an empty "{0}" to\n'\ @@ -1276,7 +1287,6 @@ class EqualRadius(BaseSketch): raise RuntimeError('Constraint "{}" requires at least one ' 'Draft.Circle'.format(cls.getName())) - # class CubicLineTangent(BaseSketch): # _id = 31 # diff --git a/system.py b/system.py index a6f31b8..2197f38 100644 --- a/system.py +++ b/system.py @@ -170,6 +170,12 @@ class SystemExtension(object): h.append(self.addAngle(angle,False,e1,e2,group=group)) return h + def addColinear(self,e1,e2,wrkpln=0,group=0): + h = [] + h.append(self.addParallel(e1[0],e2,wrkpln=wrkpln,group=group)) + h.append(self.addPointOnLine(e1[1],e2,wrkpln=wrkpln,group=group)) + return h + def addPlacement(self,pla,group=0): q = pla.Rotation.Q base = pla.Base