TechDraw seems not to have sufficient projection capabilities

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Roland
Posts: 333
Joined: Fri Aug 21, 2015 2:20 pm

TechDraw seems not to have sufficient projection capabilities

Post by Roland »

Dear TechDrawers,

You are doing well with the TechDraw development.

I am attaching a doc that shows my efforts to use the TechDraw WB. And compare it with Drawing WB. Apparently I am not getting the TechDraw WB functional for my purpose. I am posting it here (rather than under "Use Questions") because it seems to me that TechDraw is still a bit buggy in view of my expectations. (Maybe it's an easy thing to solve, then we move this topic to another part of the forum)

Upon trying to insert a Multiple Linked View, I am getting these errors: "App::Document::_RecomputeFeature(): Unknown exception in Feature "ProjItem" thrown", and "DVP::extractFaces - ProjItem002 -Can't make faces from projected edges"

Although not perfect, with the Draw WB I can do a lot more (as you can see).

is this a bug or drawback of TechDraw? An error in my system? A weak PC?

My system:
OS: Linux Mint 19.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

best regards

Roland
Attachments
ConcentricPipes.FCStd
(892.48 KiB) Downloaded 54 times
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw seems not to have sufficient projection capabilities

Post by wandererfan »

Roland wrote: Tue Apr 23, 2019 7:38 pm I am attaching a doc that shows my efforts to use the TechDraw WB. And compare it with Drawing WB. Apparently I am not getting the TechDraw WB functional for my purpose. I am posting it here (rather than under "Use Questions") because it seems to me that TechDraw is still a bit buggy in view of my expectations. (Maybe it's an easy thing to solve, then we move this topic to another part of the forum)
You've discovered at least 2 bugs. Thank you for that.
The first bug is that OCC projection algorithm returns zero edges for ProjItem/Front, even though the input shape is valid.
The second bug is that OCC bounding box object fails on being queried for the extents of an empty bounding box.

If you change the Projection Direction of the Front view slightly (I used (1.0, 0.01, 0.0), then save and reload the document you'll get your Front view back.
You can also try the polygon approximation projection method (Coarse View property) or the perspective projection (Perspective property). They seem to handle the input shape and projection direction somewhat better.

git commit fbc542738c addresses the empty bounding box failure.
"DVP::extractFaces - ProjItem002 -Can't make faces from projected edges"
This warning tells you that there are spurious edges in the projection of your shape. The face detection algorithm can not find unique paths around the Face regions. If you don't need Faces for hatching, you can uncheck the "Detect Faces" preference.
Although not perfect, with the Draw WB I can do a lot more (as you can see).
Drawing module's failure to display the Front view (Ortho_0_) is likely also due to the "no edges returned" error. The "Project shape" function also fails to produce a valid projection. TechDraw, Drawing views and Project shape all use very similar code to perform projections.

Again, thanks for your debugging help.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: TechDraw seems not to have sufficient projection capabilities

Post by NormandC »

wandererfan wrote: Thu Apr 25, 2019 12:37 pm The first bug is that OCC projection algorithm returns zero edges for ProjItem/Front, even though the input shape is valid.
Part CheckGeometry reports "SimpleAssemblyShape" as an invalid solid.

This is probably some kind of compound created by one assembly add-on or another?

I wonder if a Part container holding the separate components would have produced the same zero edge error.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw seems not to have sufficient projection capabilities

Post by wandererfan »

Roland wrote: Tue Apr 23, 2019 7:38 pm
Roland, which of the assembly modules produced "SimpleAssemblyShape"?
User avatar
Roland
Posts: 333
Joined: Fri Aug 21, 2015 2:20 pm

Re: TechDraw seems not to have sufficient projection capabilities

Post by Roland »

Hello Normand and Wandererfan,

1/ Today installed updated version of FC18:
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0

The TechDraw projections now DO THE JOB!


Congrats!

2/ The SimpleAssemblyShape was created by A2plus (most recent version). If an invalid solid, perhaps a bug report should go there?

3/ Indeed, for the individual parts, no such projection errors were there. But note: those parts were assemblies as well (on another level). nested, in other words.

4/ There are numerous features that were provided by Drawing-Dimensioning and that are not included in TechDraw. Particularly regarding annotations. Unfortunately I cannot review them at this moment, since this FC18 install does not support that WB (Error: "During initialization the error type object 'PySide2.QtWidgets.QApplication' has no attribute 'UnicodeUTF8' occurred in .../.FreeCAD/Mod/drawing_dimensioning/InitGui.py")

(Actually, a hint for solving that matter would be welcome)

Greetz,

Roland
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: TechDraw seems not to have sufficient projection capabilities

Post by NormandC »

Roland wrote: Mon Apr 29, 2019 10:13 am The TechDraw projections now DO THE JOB!

Congrats!
Wandererfan's fix was added to the 0.19 development branch (master), it was not included in the latest 0.18.1 package

That it now works is unexpected.

Roland wrote: Mon Apr 29, 2019 10:13 am FC18 install does not support that WB (Error: "During initialization the error type object 'PySide2.QtWidgets.QApplication' has no attribute 'UnicodeUTF8' occurred in .../.FreeCAD/Mod/drawing_dimensioning/InitGui.py")

(Actually, a hint for solving that matter would be welcome)
Drawing Dimensioning was abandoned by its sole developer years ago, and nobody claimed its maintainership since. AFAIK it may no longer be compatible with current FreeCAD.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw seems not to have sufficient projection capabilities

Post by wandererfan »

NormandC wrote: Mon Apr 29, 2019 1:01 pm Wandererfan's fix was added to the 0.19 development branch (master), it was not included in the latest 0.18.1 package

That it now works is unexpected.
As far as I can tell, there error is still there in:
OS: Linux Mint 19
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)

If you apply the trick of adjusting the projection direction to (1,0.01,0), save the document, then reopen it, the TD page displays correctly.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw seems not to have sufficient projection capabilities

Post by wandererfan »

NormandC wrote: Fri Apr 26, 2019 4:21 am Part CheckGeometry reports "SimpleAssemblyShape" as an invalid solid.

This is probably some kind of compound created by one assembly add-on or another?
IIRC, A2+ produces Shell(s), not Solids, that might be confusing OCC.

@kwbe could confirm.
kbwbe wrote: ping
User avatar
Roland
Posts: 333
Joined: Fri Aug 21, 2015 2:20 pm

Re: TechDraw seems not to have sufficient projection capabilities

Post by Roland »

Unexpected but it is true: Latest release does the trick for exact normal views. See screenshot, attached.
I made some minor changes to the original files though. If you want to get details, I can send you the *.fcstd.

By the way, might I ask you guys to include the various annotation options of the Drawing_Dimensioning WB into TechDraw? Welding symbols, part numbering, etc.
ScreenshotTechDrawProjection.png
ScreenshotTechDrawProjection.png (251.76 KiB) Viewed 2218 times
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: TechDraw seems not to have sufficient projection capabilities

Post by wandererfan »

Roland wrote: Tue Apr 30, 2019 7:30 am By the way, might I ask you guys to include the various annotation options of the Drawing_Dimensioning WB into TechDraw? Welding symbols, part numbering, etc.
You're not the first to make this request. Believe it or not, much of that functionality is in the development queue.
Post Reply