[solved]: [NO] Change in TechDraw::findShapeOutline ?

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

[solved]: [NO] Change in TechDraw::findShapeOutline ?

Post by mlampert »

I'm pretty sure TechDraw::findShapeOutline previously included holes but now it seems it only returns the outer contour of a shape.
Using the following face as input the result is a square wire. Is this intended behaviour?
Capture.PNG
Capture.PNG (2.51 KiB) Viewed 597 times
Last edited by mlampert on Mon Jul 30, 2018 2:31 pm, edited 1 time in total.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Change in TechDraw::findShapeOutline ?

Post by chrisb »

No problem here.

OS: Ubuntu 16.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14183 (Git)
Build type: None
Branch: master
Hash: 8ef330d19ab4aa0cfd6b9a6d41d51eed30620707
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Attachments
Bildschirmfoto 2018-07-30 um 10.29.08.png
Bildschirmfoto 2018-07-30 um 10.29.08.png (16.81 KiB) Viewed 578 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6270
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Change in TechDraw::findShapeOutline ?

Post by wandererfan »

mlampert wrote: Mon Jul 30, 2018 12:50 am I'm pretty sure TechDraw::findShapeOutline previously included holes but now it seems it only returns the outer contour of a shape.
Using the following face as input the result is a square wire. Is this intended behaviour?
GitHub says that code hasn't been changed for 2 years, and the definition says:

Code: Select all

        add_varargs_method("findShapeOutline",&Module::findShapeOutline,
            "wire = findShapeOutline(shape,scale,direction) -- Project shape in direction and find outer wire of result."
So, I would say it doesn't find holes.

You could try projecting the shape yourself and using

Code: Select all

        add_varargs_method("edgeWalker",&Module::edgeWalker,
            "[wires] = edgeWalker(edgePile,inclBiggest) -- Planar graph traversal finds wires in edge pile."
        );
This digs all the closed wires out of a group of 2d edges and returns them sorted biggest->smallest. Set the second parm to true to include the outer wire. This is what findShapeOutline uses under the covers.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Change in TechDraw::findShapeOutline ?

Post by mlampert »

wandererfan wrote: Mon Jul 30, 2018 12:46 pm GitHub says that code hasn't been changed for 2 years, and the definition says:
Yeah - I had checked and that's what confused me here. As it turns out, the change is not in TechDraw, the change is in our use of TechDraw. I added invocation a month ago to work around a deficiency in PathArea - and neglected to test support for holes :oops:

Sorry for the noise.
Post Reply