Build face(s) on base by mapping planar face(s) onto the (u,v) space of base.
(base: Shape, *fcs: Shape, tol: float = 1e-6, N: int = 20)
| 6009 | |
| 6010 | |
| 6011 | def faceOn(base: Shape, *fcs: Shape, tol: float = 1e-6, N: int = 20) -> Face | Compound: |
| 6012 | """ |
| 6013 | Build face(s) on base by mapping planar face(s) onto the (u,v) space of base. |
| 6014 | """ |
| 6015 | |
| 6016 | rv: Shape |
| 6017 | rvs = [] |
| 6018 | |
| 6019 | # get a face |
| 6020 | fbase = _get_one(base, "Face") |
| 6021 | |
| 6022 | # iterate over all faces |
| 6023 | for el in fcs: |
| 6024 | for fc in el.Faces(): |
| 6025 | # construct pcurves and trim in one go |
| 6026 | rvs.append( |
| 6027 | fbase.trim( |
| 6028 | tcast(Wire, wireOn(fbase, fc.outerWire(), tol=tol, N=N)), |
| 6029 | *( |
| 6030 | tcast(Wire, wireOn(fbase, w, tol=tol, N=N)) |
| 6031 | for w in fc.innerWires() |
| 6032 | ), |
| 6033 | ) |
| 6034 | ) |
| 6035 | |
| 6036 | if len(rvs) == 1: |
| 6037 | rv = rvs[0] |
| 6038 | else: |
| 6039 | rv = compound(rvs) |
| 6040 | |
| 6041 | return rv |
| 6042 | |
| 6043 | |
| 6044 | def _process_sewing_history( |