View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002542 | Part | Bug | public | 2016-05-10 22:29 | 2017-05-10 19:57 |
Reporter | sliptonic | Assigned To | sliptonic | ||
Priority | high | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 0.17 | ||||
Target Version | 0.17 | ||||
Summary | 0002542: Part.Wire.makeoffset() doesn't handle circles correctly. | ||||
Description | If I have a wire from an irregular shape and perform a Part.Wire.makeoffset(-1), it returns a shape object with a list of wires and list of edges. However, if I start with a wire from a circular face, the offset returns a list of edges but the wire list is empty. I can use DraftGeomUtils.findwire() to join them, but my expectation is that makeoffset would act consistently in both cases. | ||||
Steps To Reproduce | Attached screenshot shows what I mean, reproduced in the console. | ||||
Additional Information | OS: Linux Mint 17.3 Rosa Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.17.7514 +17 (Git) Build type: Unknown Branch: pathimprove Hash: f20a1ed9055f09880b26e00fa841b062bf679c7d Python version: 2.7.6 Qt version: 4.8.6 Coin version: 4.0.0a OCC version: 6.7.0 | ||||
Tags | Part | ||||
FreeCAD Information | |||||
related to | 0002541 | closed | FreeCAD | Part.Wire.makeoffset() doesn't offset single edge. |
|
|
|
When trying to offset a wire from a circle or circular face the result is again a wire. Maybe it's related to your model that it doesn't work. Would it be possible to upload a model where it fails? |
|
|
|
|
|
|
|
|
|
I've uploaded a simple model and a screenshot of a run using the macro circleoffsettest2. (Please ignore circleoffsettest. It's bad and I can't figure out how to delete a file from mantis) The results first show selection of the top face, then the flat circular face. You can see that the wire list is empty in the second. It's also worth noting that if I select either of the cylindrical faces and run the offset test, FreeCAD crashes with a segmentation violation. |
|
Some more weirdness: I rewrote my test macro like below. If I offset the top face, the new edge length is the same as the old edge length as though it doesn't offset at all. If I set the offset value to a negative number, then it offsets inward and the new length is shorter as expected. But using the negative offset value on the circular face, it offsets outward and the new edge gets longer. Summarized resullts are: Circle | Irregular =========== | ============== -1 | offset outward | offset inward 1 | offset inward | unchanged import DraftGeomUtils as DGU o = FreeCADGui.Selection.getSelectionEx()[0].SubObjects[0] print "original edge len " + str(o.Edges[0].Length) for i in range (0,10): n = o.makeOffset(1) #change to negative value print n print n.Wires print n.Edges print "newedge len: " + str(o.Edges[0].Length) o = DGU.findWires(n.Edges)[0] |
|
I think the crash happens because the face is not planar. The class documentation of BRepOffsetAPI_MakeOffset it says: //! Describes algorithms for offsetting wires from a set of //! wires contained in a planar face. So it should be checked if the face/wire is planar and raise an error if needed. |
|
@sliptonic per wmayer > So it should be checked if the face/wire is planar and raise an error if needed. |
|
I'm looking for a way to test from Python if a face is planar. I haven't found anything yet. |
|
> I'm looking for a way to test from Python if a face is planar. I haven't found anything yet. @DeepSOIC would you mind weighing in on this? |
|
@sliptonic |
|
Yikes this ticket didn't save the attachments after the backup. @sliptonic is that going to be a problem? |
|
The issue is a year old. I don't have the files anymore and I can't even remember the context. Let's close this. |
|
Context is no longer relevant and work-around is possible. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-05-10 22:29 | sliptonic | New Issue | |
2016-05-10 22:29 | sliptonic | File Added: Selection_029.png | |
2016-05-11 08:45 | wmayer | Note Added: 0007078 | |
2016-05-11 12:38 | sliptonic | File Added: circleoffsettest.FCMacro | |
2016-05-11 12:39 | sliptonic | File Added: offsettest.fcstd | |
2016-05-11 12:43 | sliptonic | File Added: Selection_030.png | |
2016-05-11 12:48 | sliptonic | File Added: circleoffsettest2.fcmacro | |
2016-05-11 12:52 | sliptonic | Note Added: 0007080 | |
2016-05-11 13:25 | sliptonic | Note Added: 0007081 | |
2016-05-11 13:26 | sliptonic | Note Edited: 0007081 | |
2016-05-11 13:26 | sliptonic | Note Edited: 0007081 | |
2016-05-11 21:11 | wmayer | Note Added: 0007083 | |
2016-05-12 17:03 | wmayer | Changeset attached | => FreeCAD Master master c21888af |
2017-01-11 18:14 | Kunda1 | Note Added: 0007638 | |
2017-01-11 18:14 | Kunda1 | Status | new => feedback |
2017-01-18 01:06 | Kunda1 | Relationship added | related to 0002541 |
2017-03-02 19:05 | sliptonic | Note Added: 0008521 | |
2017-03-02 19:05 | sliptonic | Status | feedback => new |
2017-03-21 12:44 | Kunda1 | Note Added: 0008677 | |
2017-03-21 12:44 | Kunda1 | Note Edited: 0008677 | |
2017-03-21 12:45 | Kunda1 | Product Version | => 0.17 |
2017-03-21 12:45 | Kunda1 | Target Version | => 0.17 |
2017-03-21 17:54 | DeepSOIC | Note Added: 0008682 | |
2017-03-21 18:11 | Kunda1 | Assigned To | => sliptonic |
2017-03-21 18:11 | Kunda1 | Status | new => feedback |
2017-05-02 13:26 | Kunda1 | Tag Attached: Part | |
2017-05-02 13:29 | Kunda1 | Note Added: 0008853 | |
2017-05-02 13:54 | sliptonic | Note Added: 0008854 | |
2017-05-02 13:55 | sliptonic | Status | feedback => closed |
2017-05-02 13:55 | sliptonic | Resolution | open => no change required |
2017-05-02 13:55 | sliptonic | Note Added: 0008855 | |
2017-05-10 19:57 | Kunda1 | Project | FreeCAD => Part |