|
| 1 | +# Sketcher Refactor 2: April 2025 Update |
| 2 | + |
| 3 | + |
| 4 | +## What was done |
| 5 | + |
| 6 | +* Work log includes changes from December 2024. |
| 7 | +* Plenty of delays from a lot of travel, plus day job. |
| 8 | +* Things are now getting merged. |
| 9 | +* Lot of time putting out fires: corner cases and memory leak issues in `trim`. |
| 10 | +* Added a `SketchObject::replaceGeometries` method, that handles the riskier operations. If an error related to memory leak exists, it has to be here. |
| 11 | + |
| 12 | +Current status, with remaining "complex" functions shown (the "before", as I added in the previous reports, doesn't make much sense now that a lot of work is merged): |
| 13 | + |
| 14 | +| Line | Function | Complexity | Test | Macros | |
| 15 | +|----------|------------------------------|------------|------|--------| |
| 16 | +| 330:20 | `buildShape` | 43 | | | |
| 17 | +| 467:31 | `buildInternals` | 32 | | x | |
| 18 | +| 774:20 | `generateId` | 59 | | x | |
| 19 | +| 2386:19 | `delConstraintOnPoint` | 35 | | | |
| 20 | +| 2510:20 | `transferFilletConstraints` | 69 | | | |
| 21 | +| 3547:20 | `deriveConstraintsForPieces` | 29 | | | |
| 22 | +| 4145:19 | `addSymmetric` | 78 | | | |
| 23 | +| 4373:44 | `getSymmetric` | 56 | | | |
| 24 | +| 4764:19 | `addCopy` | 172 | | | |
| 25 | +| 4809:32 | (lambda within `addCopy`) | 123 | | | |
| 26 | +| 5317:19 | `removeAxesAlignment` | 36 | | | |
| 27 | +| 6884:19 | `carbonCopy` | 66 | | | |
| 28 | +| 7092:19 | `addExternal` | 47 | | | |
| 29 | +| 7255:20 | `delExternalPrivate` | 27 | | | |
| 30 | +| 7430:19 | `attachExternal` | 39 | | x | |
| 31 | +| 8032:6 | `processEdge` | 144 | | | |
| 32 | +| 8581:20 | `rebuildExternalGeometry` | 345 | | | |
| 33 | +| 9044:20 | `fixExternalGeometry` | 63 | | x | |
| 34 | +| 9618:27 | `validateExpression` | 35 | | | |
| 35 | +| 9889:20 | `onGeometryChanged` | 45 | | x | |
| 36 | +| 10023:20 | `onExternalGeoChanged` | 58 | | x | |
| 37 | +| 10146:20 | `onExpressionEngineChanged` | 40 | | x | |
| 38 | +| 10198:20 | `updateGeometryRefs` | 121 | | x | |
| 39 | +| 10432:20 | `restoreFinished` | 71 | | | |
| 40 | +| 10489:20 | `migrateSketch` | 57 | | | |
| 41 | +| 10752:19 | `port_reversedExternalArcs` | 42 | | | |
| 42 | +| 10943:36 | `getSubObject` | 70 | | | |
| 43 | +| 11083:15 | `getHigherElements` | 27 | | | |
| 44 | +| 11140:20 | `setExpression` | 39 | | x | |
| 45 | +| 11177:36 | `getElementName` | 36 | | | |
| 46 | +| 11271:33 | `checkSubName` | 70 | | x | |
| 47 | + |
| 48 | +## Next steps |
| 49 | + |
| 50 | +* Remove all/most of the code that changes data in Sketcher _without breaking the sketch_. |
| 51 | +* Some things that still need to stay: delete/add geometry/constraints/externalgeometry. |
| 52 | +* Create a "function object" so that the editing procedure is straightforward. |
| 53 | +* No new refactoring grant planned, ideally should be done by everyone. |
| 54 | + |
0 commit comments