return inShape with placement and scaler applied. If inShape contains any infinite subshapes (such as Datum planes), the infinite shapes will not be included in the result.
| 186 | //! return inShape with placement and scaler applied. If inShape contains any infinite subshapes |
| 187 | //! (such as Datum planes), the infinite shapes will not be included in the result. |
| 188 | TopoDS_Shape ShapeFinder::transformShape( |
| 189 | TopoDS_Shape& inShape, |
| 190 | const Base::Placement& placement, |
| 191 | const Base::Matrix4D& scaler |
| 192 | ) |
| 193 | { |
| 194 | if (isShapeReallyNull(inShape)) { |
| 195 | return {}; |
| 196 | } |
| 197 | // we modify the parameter shape here. we don't claim to be const, but may be better to copy |
| 198 | // the shape? |
| 199 | Part::TopoShape tshape {inShape}; |
| 200 | if (tshape.isInfinite()) { |
| 201 | inShape = stripInfiniteShapes(inShape); |
| 202 | } |
| 203 | |
| 204 | // copying the shape prevents "non-orthogonal GTrsf" errors in some versions |
| 205 | // of OCC. Something to do with triangulation of shape?? |
| 206 | // it may be that incremental mesh would work here too. |
| 207 | BRepBuilderAPI_Copy copier(inShape); |
| 208 | tshape = Part::TopoShape(copier.Shape()); |
| 209 | if (tshape.isNull()) { |
| 210 | return {}; |
| 211 | } |
| 212 | |
| 213 | tshape.transformShape(scaler, true, true); |
| 214 | tshape.setPlacement(placement); |
| 215 | |
| 216 | return tshape.getShape(); |
| 217 | } |
| 218 | |
| 219 | |
| 220 | //! this getter should work for any object, not just links |
nothing calls this directly
no test coverage detected