The Big TechDraw Comments Thread

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: The Big TechDraw Comments Thread

Post by Jee-Bee »

wandererfan wrote:Plans for next release:
- high resolution Drawings
---- higher quality DrawViewImage
---- bitmap (png/jpeg) "hatching"
---- scalable hatches
Why bitmap hatching and not create hatch by one or two sets of lines. That's the way it is done in at least PTC Pro-E Wild Fire/ Creo.
choose spacing; angles and thickness of two sets lines and all needed is possible...
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: The Big TechDraw Comments Thread

Post by wandererfan »

Jee-Bee wrote:Why bitmap hatching and not create hatch by one or two sets of lines. That's the way it is done in at least PTC Pro-E Wild Fire/ Creo.
choose spacing; angles and thickness of two sets lines and all needed is possible...
Because bitmap hatching costs me a dozen lines of code, but proper technical hatching takes some time & thought.
The AutoCad PAT files I mentioned work similarly: origin, angle,spacing, thickness...
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: The Big TechDraw Comments Thread

Post by yorik »

The ideal way would be using SVG patterns. This is by far the most advanced and powerful hatching system. You encapsulate any kind of SVG elements inside a pattern, give it an id, then any element can by filled with that pattern giving its id to the fill property. Simple as that. Unfortunately, Qt doesn't support svg patterns. I had seen somewhere that Qt5 would, but apparently it didn't happen.

I think wandererfan's approach is the best for now, because using bitmap fills works similarly, and should be relatively easy to convert to svg patterns the day we find a way to support it...
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: The Big TechDraw Comments Thread

Post by efyx »

wandererfan wrote:Plans for next release..
Cannot wait to check :x btw. thank you for all what've you done so far. I am waiting for detail view, tolerances, center lines (holes and tube like) and weld symbols. I prefere more stuff whis is not polished, but incresing functionality of TD WB. Anyway great stuff. Tell if you need some welding symbols or something else what can be prepared in svg - that's what I can offer from my side.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: The Big TechDraw Comments Thread

Post by wandererfan »

yorik wrote:The ideal way would be using SVG patterns. This is by far the most advanced and powerful hatching system. You encapsulate any kind of SVG elements inside a pattern, give it an id, then any element can by filled with that pattern giving its id to the fill property. Simple as that. Unfortunately, Qt doesn't support svg patterns. I had seen somewhere that Qt5 would, but apparently it didn't happen.
The best we could do right now would be to postprocess the Qt generated svg file and add the pattern elements to it. Then at least they'd be in the file when you opened it in Inkscape.
Looking inside the generated file, I don't see anything that would allow you to match chunks of svg back to the source views. A label or a comment would be nice.
I think wandererfan's approach is the best for now, because using bitmap fills works similarly, and should be relatively easy to convert to svg patterns the day we find a way to support it...
Very similar. If the hatch filespec ends in svg, we use the existing mosaic tiling solution. If it ends in png/jpg, we use Qt's bitmap fill functions (which is a mosaic tile solution internally).

That said, I'm going to implement an additional system similar to AutoCad PAT or the PTC Pro-E Wild Fire/ Creo approach @Jee-Bee mentioned. That will satisfy the hardcore mechanical drawing requirement and the svg/bitmap approach will handle the more artistic requirements.

wf
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: The Big TechDraw Comments Thread

Post by wandererfan »

efyx wrote:I am waiting for detail view, tolerances, center lines (holes and tube like) and weld symbols.
The detail view is there (minus the circle in the original drawing). Circular arcs can get center marks, and there's a property that gives centerlines to the view (but not to individual objects in the view).

There are a bunch of svg symbols (from @bavariaShape) in the source distribution, but I'm not sure if they get installed automatically. The pictorial ones are ok, but I'm not happy with the ones that need text inside them. The text is either too big or too small.
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: The Big TechDraw Comments Thread

Post by pablogil »

wandererfan wrote:That said, I'm going to implement an additional system similar to AutoCad PAT or the PTC Pro-E Wild Fire/ Creo approach @Jee-Bee mentioned. That will satisfy the hardcore mechanical drawing requirement and the svg/bitmap approach will handle the more artistic requirements.

wf
If you create an additional system similar to PAT, would it be possible for us, "pro users", to create and add our own new patterns?

Thanks
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: The Big TechDraw Comments Thread

Post by wandererfan »

pablogil wrote:If you create an additional system similar to PAT, would it be possible for us, "pro users", to create and add our own new patterns?
Yes. There will be a file or files containing patterns. You'll be able to edit or create files and choose one from the gui. Right now I'm leaning towards a CSV file something like: angle,interval,.... which is very much like PAT. Wonder if we have to worry about patent infringement? Could make an XML instead, I guess.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: The Big TechDraw Comments Thread

Post by NormandC »

Hello wandererfan,

Should we still post bugs here, or would you rather I create a separate topic for each issue?

I found one surefire way to crash FreeCAD :D :
  1. Create a new document
  2. Open the TechDraw wb
  3. Click on "Insert new default drawing page"
  4. Click on the arrow in front of Page to reveal the Template
  5. Delete Template (right-click and "Delete")
  6. A dialog opens:
    The following, referencing objects might break.

    Are you sure you want to continue?

    Page
    Click OK
  7. Select Page in Model tree
  8. Hit delete
  9. Boom! Instant crash.
Terminal output:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
App::DocumentObject::getNameInDocument (this=0x0)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/App/DocumentObject.cpp:133
133	/build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/App/DocumentObject.cpp: Aucun fichier ou dossier de ce type.
"Aucun fichier ou dossier de ce type." means "No file or folder with this name".

backtrace:

Code: Select all

#0  App::DocumentObject::getNameInDocument (this=0x0)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/App/DocumentObject.cpp:133
#1  0x00007fff5ba26c2d in TechDraw::DrawPage::unsetupObject (this=0x2593850)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Mod/TechDraw/App/DrawPage.cpp:331
#2  0x00007ffff6d27ea6 in App::Document::remObject (this=0x1deb4e0, 
    sName=sName@entry=0x7fffe5165ec4 "Page")
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/App/Document.cpp:2293
#3  0x00007ffff6d73aad in App::DocumentPy::removeObject (
    this=this@entry=0xd5b5b0, args=<optimized out>)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/App/DocumentPyImp.cpp:278
#4  0x00007ffff6d73bd7 in App::DocumentPy::staticCallback_removeObject (
    self=0xd5b5b8, args=<optimized out>)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/obj-x86_64-linux-gnu/src/App/DocumentPy.cpp:1197
#5  0x00007ffff651d0d4 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#6  0x00007ffff651e54d in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#7  0x00007ffff651e682 in PyEval_EvalCode ()
#8  0x00007ffff65184b9 in PyRun_StringFlags ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#9  0x00007ffff698e0b4 in Base::InterpreterSingleton::runString (
    this=<optimized out>, 
    sCmd=sCmd@entry=0x281ba38 "App.getDocument(\"Sans_nom\").removeObject(\"Page\")")
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Base/Interpreter.cpp:196
#10 0x00007ffff742e692 in Gui::Command::doCommand (
    eType=eType@entry=Gui::Command::Doc, 
    sCmd=sCmd@entry=0x7ffff7a1e350 "App.getDocument(\"%s\").removeObject(\"%s\")")
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Gui/Command.cpp:475
#11 0x00007ffff743bb23 in StdCmdDelete::activated (this=<optimized out>, 
    iMsg=<optimized out>)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Gui/CommandDoc.cpp:1155
#12 0x00007ffff74337bc in Gui::Command::invoke (this=0x9e6810, i=0)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Gui/Command.cpp:300
#13 0x00007ffff538987a in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007ffff58a0a62 in QAction::triggered(bool) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x00007ffff58a2433 in QAction::activate(QAction::ActionEvent) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x00007ffff58a258c in QAction::event(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#17 0x00007ffff58a6e2c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#18 0x00007ffff58ad4a0 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#19 0x00007ffff740f891 in Gui::GUIApplication::notify (this=0x7fffffffd670, 
    receiver=0x1afa390, event=0x7fffffffc360)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Gui/GuiApplication.cpp:91
#20 0x00007ffff53754dd in QCoreApplication::notifyInternal(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007ffff58d82a6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#22 0x00007ffff58d83dc in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#23 0x00007ffff58ae773 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#24 0x00007ffff740f891 in Gui::GUIApplication::notify (this=0x7fffffffd670, 
    receiver=0xb01110, event=0x7fffffffc830)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Gui/GuiApplication.cpp:91
#25 0x00007ffff53754dd in QCoreApplication::notifyInternal(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#26 0x00007ffff5946027 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#27 0x00007ffff59463c9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#28 0x00007ffff5920417 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#29 0x00007ffff5948b32 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#30 0x00007fffee214e04 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007fffee215048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007fffee2150ec in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007ffff53a27a1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#34 0x00007ffff5948be6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#35 0x00007ffff53740af in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#36 0x00007ffff53743a5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#37 0x00007ffff5379b79 in QCoreApplication::exec() ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#38 0x00007ffff73cd7d1 in Gui::Application::runApplication ()
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Gui/Application.cpp:1735
#39 0x00000000004032cd in main (argc=1, argv=<optimized out>)
    at /build/freecad-daily-KLVQIW/freecad-daily-0.17~alpha1+git201701312145~ubuntu14.04.1/src/Main/MainGui.cpp:237
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9927 (Git)
Build type: None
Branch: master
Hash: 2780edd903e9819eb0d0940ca0e754f1124ac188
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: The Big TechDraw Comments Thread

Post by wandererfan »

NormandC wrote:Should we still post bugs here, or would you rather I create a separate topic for each issue?
issue #2884 time to join the main stream, I guess.
I found one surefire way to crash FreeCAD :D :
Don't know if they were ever translated, but the vaudeville act "Smith & Dale" https://en.wikipedia.org/wiki/Smith_%26_Dale addressed this sort of thing:
PATIENT: Doctor, it hurts when I do this.
DOCTOR: Don't do that.

Thanks for the report. ;)
wf
Post Reply