constraint: remove planar requirement in Attachment constraint

This commit is contained in:
Zheng, Lei 2019-06-30 17:30:54 +08:00
parent 73a8eb684c
commit b536a9d374

View File

@ -249,10 +249,10 @@ def _lw(solver,partInfo,subname,shape,retAll=False):
return _l(solver,partInfo,subname,shape,False)
return _wa(solver,partInfo,subname,shape)
def _w(solver,partInfo,subname,shape,retAll=False):
def _w(solver,partInfo,subname,shape,retAll=False,noCheck=False):
'return a handle of a transformed plane/workplane from "shape"'
if not solver:
if utils.isPlanar(shape):
if noCheck or utils.isPlanar(shape):
return
return 'an edge/face with a planar surface'
@ -274,6 +274,10 @@ def _wa(solver,partInfo,subname,shape,retAll=False):
_ = retAll
return _w(solver,partInfo,subname,shape,True)
def _wa_no_check(solver,partInfo,subname,shape,retAll=False):
_ = retAll
return _w(solver,partInfo,subname,shape,True,True)
def _c(solver,partInfo,subname,shape,requireArc=False,retAll=False):
'return a handle of a transformed circle/arc derived from "shape"'
if not solver:
@ -1292,6 +1296,7 @@ class Attachment(BaseCascade):
'Add a "{}" constraint to attach two parts by the selected geometry\n'\
'elements. This constraint completely fixes the parts relative to each\n'\
'other.'
_entityDef = (_wa_no_check,)
class AxialAlignment(BaseMulti):