High resolution drawings in FreeCAD

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
cadmar2021
Posts: 15
Joined: Fri Dec 17, 2021 9:11 pm

High resolution drawings in FreeCAD

Post by cadmar2021 »

Good day all,
My setup:
OS: Linux Mint 20.2, KDE Flatpak runtime (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.14555 (Git shallow)
Build type: Release
Branch: (HEAD detached at 0.19.3)
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.9.9
Qt version: 5.15.3
Coin version: 4.0.0
OCC version: 7.3.0
Locale: English/United States (en_US)

I have a problem trying to import a part view into a drawing with TechDraw workbench. Although the part is defined with high resolution (0.01deg deviation and 0.01% deviation), once imported in the drawing page, the curves are coarse and segmented. I've tried everything but I can't resolve that one. My working file attached.

Help!
Attachments
Main_rib_profile.FCStd
(32.99 KiB) Downloaded 49 times
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: High resolution drawings in FreeCAD

Post by chrisb »

Didn't I read about this in another topic from you?

Edit: this is where it started: https://forum.freecadweb.org/viewtopic. ... 09#p554909.

Besides: you should update your FreeCAD, it's rather old.

Should this be moved to TechDraw forum?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
cadmar2021
Posts: 15
Joined: Fri Dec 17, 2021 9:11 pm

Re: High resolution drawings in FreeCAD

Post by cadmar2021 »

Hi chrisb, yes that topic followed suit to an earlier problem which was resolved... sort of but not completely.
I'll try to update my version of FreeCAD but not sure it will make a big difference with regards to this problem.
So.... how do you move this topic to another forum? ---- TechDraw?

Regards and thanks!
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: High resolution drawings in FreeCAD

Post by chrisb »

I moved the topic.

And yes, you are probably right that an update will not make much of a difference :( .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: High resolution drawings in FreeCAD

Post by wmayer »

cadmar2021 wrote: Sun Dec 19, 2021 9:09 pm Although the part is defined with high resolution (0.01deg deviation and 0.01% deviation), once imported in the drawing page, the curves are coarse and segmented. I've tried everything but I can't resolve that one. My working file attached.
This of course has no impact on the resolution of the drawing. The shape you see in the 3d view is projected to a 2D plane and the projected shape serves than as input for the drawing.

It took my a while to figure out where in the code the projected shape gets "meshed" so that it can be displayed. It's done here:
https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L1070

The part of the shape you talk about is a B-Spline curve. When inspecting it in more details it reveals that the degree of this curve is only 1 and consists of 14 segments. In other words the curve at this point is a normal polyline.

So, the question is whether there a was post-processing step after the projection or it's the real output of the projection. Thus, I added some test code inside GeometryObject::projectShape to inspect the output and the polyline is indeed the output of the projection.

In other words I don't think there is a way to get a curve of higher resolution in your drawing.
cadmar2021
Posts: 15
Joined: Fri Dec 17, 2021 9:11 pm

Re: High resolution drawings in FreeCAD

Post by cadmar2021 »

Thanks wmayer for your hard work!
wmayer wrote: Mon Dec 20, 2021 11:45 am So, the question is whether there a was post-processing step after the projection or it's the real output of the projection. Thus, I added some test code inside GeometryObject::projectShape to inspect the output and the polyline is indeed the output of the projection.

In other words I don't think there is a way to get a curve of higher resolution in your drawing.
I suspected as much...
Although this exceeds my competence, is there not a possibility to increase the resolution and recompile? How then and in what format do you output a file capable of driving a CNC router with sufficient resolution? I'll have to investigate the fabrication aspect of FreeCAD, surely that is not plagued by low resolution output?
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: High resolution drawings in FreeCAD

Post by wmayer »

is there not a possibility to increase the resolution and recompile
Sorry, don't know what you mean with "recompile". You mean to change the source code and then recompile it or what?

So far the problem is that in your original 3d model the one curve is a parabola and the projection algorithm of the CAD kernel converts it into a B-Spline of degree 1 and that's the whole problem. I don't know if there is a way to configure the algorithm to at least create a B-Spline of degree 2.
How then and in what format do you output a file capable of driving a CNC router with sufficient resolution? I'll have to investigate the fabrication aspect of FreeCAD, surely that is not plagued by low resolution output?
I have no idea about CNC and all this stuff. You should ping developers of the Path workbench. Maybe they can help you.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: High resolution drawings in FreeCAD

Post by chrisb »

CNC-Output is indeed a completely different thing, and you should create the CNC paths directly from the model. The right operation would probably be the 3D-surface operation.

However, CNC output is usually created for milling machines and thus much coarser than possibly needed for a perfectly shiny mirror. What resolution do you need?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
cadmar2021
Posts: 15
Joined: Fri Dec 17, 2021 9:11 pm

Re: High resolution drawings in FreeCAD

Post by cadmar2021 »

wmayer wrote: Mon Dec 20, 2021 4:08 pm Sorry, don't know what you mean with "recompile". You mean to change the source code and then recompile it or what?

So far the problem is that in your original 3d model the one curve is a parabola and the projection algorithm of the CAD kernel converts it into a B-Spline of degree 1 and that's the whole problem. I don't know if there is a way to configure the algorithm to at least create a B-Spline of degree 2.
Yes, I mean change the source code and recompile. Unfortunately, I don't have that expertise. I'm absolutely certain that increasing the degree of the B-Spline is possible and relatively easy. From the comments in the source code, this was a choice of the programmer that concluded that since the display could not resolve higher resolution that this was not necessary.... wrong!

There are yet a number of options I will pursue, including generating the curve outside of FC in DXF and importing it in FC as B-Spline segments
Screenshot from 2021-12-20 14-02-19.png
Screenshot from 2021-12-20 14-02-19.png (266.17 KiB) Viewed 3472 times
by deselecting the "Treat ellipses and splines as polylines" option in the DXF import preferences in FC. Once imported as proper splines, I'm hoping to coax FC into producing higher resolution exports. To be continued...

As for
chrisb wrote: Mon Dec 20, 2021 6:13 pm CNC-Output is indeed a completely different thing, and you should create the CNC paths directly from the model. The right operation would probably be the 3D-surface operation.

However, CNC output is usually created for milling machines and thus much coarser than possibly needed for a perfectly shiny mirror. What resolution do you need?
The idea is to print the drawing at a 1/1 scale on a quality printer and glue that print onto the template material that will then be cut out along the printed lines. The template is then used to cut the mirror ribs with a router. Modern printers are easily capable of producing plots with 0.05mm accuracy or better, which is sufficient for my purpose because the mirror substrate (a 2.5mm thick sheet of plastic) absorbs small surface imperfections along the rib contour. An accuracy of 0.1mm is sufficient. I've used this method many times with SolidWorks to which I don't have access in Linux and I will not go back to Windows.
vm4dim
Posts: 130
Joined: Tue Nov 23, 2021 1:05 am

Re: High resolution drawings in FreeCAD

Post by vm4dim »

Try export Sketch to SVG
Attachments
Main_rib_profile-BodySketch.svg
(828 Bytes) Downloaded 46 times
Post Reply