Cosmetics v2

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Cosmetics v2

Post by bitacovir »

wandererfan wrote: Sat Jul 20, 2019 12:22 am
bitacovir wrote: Thu Jul 18, 2019 2:43 pm 2 Line CenterLine does not work with selected edges of a Draft Rectangle.
git commit 517b11ee3b should fix this.

Still, 2 Line CenterLine does not work. The Python panel shows this:
CenterLineBuilder - endpoints are equal: (0.000,0.000,0.000)
CenterLineBuilder - check V/H/A and/or Flip parameters

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17477 (Git)
Build type: Release
Branch: master
Hash: 8806e4490606d7a1be52c831049b17d8c8d9c320
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Cosmetics v2

Post by wandererfan »

bitacovir wrote: Fri Jul 26, 2019 9:17 pm Still, 2 Line CenterLine does not work. The Python panel shows this:
CenterLineBuilder - endpoints are equal: (0.000,0.000,0.000)
CenterLineBuilder - check V/H/A and/or Flip parameters
Doesn't work sometimes or never works?

The most likely situation is that you have selected 2 lines that are happen to be specified in reverse order. For example top to bottom on one and bottom to top on the other. This is what the "Flip" parameter is for - it reverses the point order for 1 of the lines.

If there is a general method to detect this situation, I haven't found it yet.
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Cosmetics v2

Post by bitacovir »

My apologies. Maybe I did not provide enough information.
This only happens with a view of a rectangle made with Draft Rectangle tool. With view of other shapes using Draft polyline or a view of a volume like a wall works fine.
The steps I do are the following:

- Draw a rectangle with Draft rectangle tool
- Create a view of the rectangle in TDWB and set the scale (in my case to 0.1)
- Select both left and right edges of the rectangle (using Crtl key)
- Click on 2 Line CenterLine and Ok

Maybe the version I am using does not include your amendment...
2lines2.gif
2lines2.gif (438.93 KiB) Viewed 1508 times
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17477 (Git)
Build type: Release
Branch: master
Hash: 8806e4490606d7a1be52c831049b17d8c8d9c320
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Cosmetics v2

Post by wandererfan »

bitacovir wrote: Sat Jul 27, 2019 2:10 pm - Draw a rectangle with Draft rectangle tool
- Create a view of the rectangle in TDWB and set the scale (in my case to 0.1)
- Select both left and right edges of the rectangle (using Crtl key)
<<<<< click the flip ends radio button before pressing OK <<<<<<<<<
- Click on 2 Line CenterLine and Ok
When you get these messages, try again, but use the "flip ends" radio button in the "2 Lines" section of the TaskView.
DraftRectCenterline.png
DraftRectCenterline.png (76.25 KiB) Viewed 1491 times
I get nice centerlines on draft rectangles by using the flip option in my freecad-daily:

OS: Linux Mint 19 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Cosmetics v2

Post by wandererfan »

First time trying this animated gif thing. Quality might not be up to scratch.
2LineFlipParm.gif
2LineFlipParm.gif (533.15 KiB) Viewed 1487 times
chrisb
Veteran
Posts: 54168
Joined: Tue Mar 17, 2015 9:14 am

Re: Cosmetics v2

Post by chrisb »

Quality is good. Your improvements are even better.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Cosmetics v2

Post by bitacovir »

wandererfan wrote: Sat Jul 27, 2019 7:00 pm When you get these messages, try again, but use the "flip ends" radio button in the "2 Lines" section of the TaskView.
Thank you. It works.
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
aapo
Posts: 617
Joined: Mon Oct 29, 2018 6:41 pm

Re: Cosmetics v2

Post by aapo »

Hi!

I think I found some new bugs with the cosmetic centerlines. The angular dimension values between the centerlines get sometimes lost and show zero angle when using the angle tool in TechDraw workbench, and the report view says DVD::getDimValue - Dimension - 2D references are corrupt. Also, in principle there are four possible quadrants between two crossing lines to put angle dimensions into, but I've only managed to insert angle dimensions into one of them (and it seems to be quite random which one of the quadrants will be used). It'd be nice to be able to select any of the four quadrants for the angle dimension. Specifically, in the example problem I'd like to be able to have an angle dimension showing "120.00" inserted below and/or above the horizontal center line. Simple FCStd file showing the problem is included.

EDIT: After further trial and error, I realized that the selection order of the two centerlines when using the angle tool has an effect on the quadrant selection. It seems that at first I always selected the lines in the same order before pressing the angle tool, and did not realize this. Now I'm able to add an angle dimension with "120.00" as a value to the lower left quadrant. However, it's still only possible to select two of the four quadrants, because there's only two possible selection orders (AB or BA), and I don't find the quadrant selection logic very obvious with the current implementation.
FreeCAD-TechDraw-polar-centerlines-01.png
FreeCAD-TechDraw-polar-centerlines-01.png (63.91 KiB) Viewed 1384 times
FreeCAD-TechDraw-polar-centerlines-02.png
FreeCAD-TechDraw-polar-centerlines-02.png (2.7 KiB) Viewed 1384 times

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17651 (Git)
Build type: Release
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Attachments
FreeCAD-TechDraw-polar-centerlines.FCStd
(48.46 KiB) Downloaded 47 times
User avatar
wandererfan
Veteran
Posts: 6309
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Cosmetics v2

Post by wandererfan »

aapo wrote: Thu Aug 15, 2019 1:03 pm I think I found some new bugs with the cosmetic centerlines.
Is the behaviour of the dimensions different between geometry lines and cosmetic lines?
The angular dimension values between the centerlines get sometimes lost and show zero angle when using the angle tool in TechDraw workbench, and the report view says DVD::getDimValue - Dimension - 2D references are corrupt.
This is probably edge numbers changing between executions. I'll look at a way to remember the cosmetic line number since it changes less often than the geometry numbers.
Also, in principle there are four possible quadrants between two crossing lines to put angle dimensions into, but I've only managed to insert angle dimensions into one of them (and it seems to be quite random which one of the quadrants will be used). It'd be nice to be able to select any of the four quadrants for the angle dimension. Specifically, in the example problem I'd like to be able to have an angle dimension showing "120.00" inserted below and/or above the horizontal center line. Simple FCStd file showing the problem is included.
You should be able to get inner and outer angles moving the dimension text across the intersection point. I think all the test cases todate were for angles with a real vertex at the apex. Two crossing lines with out a vertex hasen't been considered before this .

Likewise picking a quadrant has never come up before this. I'll look into it.

Thanks for reporting.
aapo
Posts: 617
Joined: Mon Oct 29, 2018 6:41 pm

Re: Cosmetics v2

Post by aapo »

wandererfan wrote: Thu Aug 15, 2019 2:47 pm Is the behaviour of the dimensions different between geometry lines and cosmetic lines?
I think the main difference are the new situations arising from the fact that you noticed: Two centerlines (or a centerline and a geometry line) can cross without having a vertex at the intersection. Other than that, I have not noticed any differences.


This is probably edge numbers changing between executions. I'll look at a way to remember the cosmetic line number since it changes less often than the geometry numbers.
Indeed. But please note that a) the 3D-model was not modified at all between the executions, and b) the zero-valued selected (green) angular dimension is still at its correct position, i.e. it seems to be connected to the correct centerlines. Usually, when the edge numbering changes when touching the 3D-model, both the values and positions of the dimensions get distorted. In this case, just the measured value is wrong, which seems odd. Could it be somehow related to the "flip lines" functionality, when adding the centerline? Is it possible that the line directions get somehow confused when re-calculating the angular value?

Also, regarding the "flip lines" functionality in the "Add centerline between lines" tool: If adding the centerline fails with the error message asking the user to flip the lines in order to (possibly) make the formation of centerline feasible, would it be possible to automatically invert the "flip lines" property after failure, and try adding the centerline again automatically. It'd be much more convenient for the user, because most times I add centerlines I have to first guess which way the "flip lines" property should be set. Most often, the two possible results for me have been 1) correct centerline, and 2) failure to add centerline. The far more rare case at least for me is the 1) correct centerline, and 2) weird centerline, for which manual intervention is indeed necessary. But it seems to me, that the more common case could be easily solved programmatically. It would also solve the problem where pressing "add centerline between lines" does nothing (except error message), which might be confusing for a novice user. Trying both options after failure in one would always give a visible centerline, which the user could later edit and fix. If nothing gets added, there's nothing to edit. I believe the reason why the centerlines (mostly) behave like that for me is the fact that most of the edges I add centerlines for are parallel to each other and of equal length, and I suspect that's quite a common case in practice (projected holes and shafts with perpendicular ends, mainly).


You should be able to get inner and outer angles moving the dimension text across the intersection point. I think all the test cases todate were for angles with a real vertex at the apex. Two crossing lines with out a vertex hasen't been considered before this .
You can get inner and outer angles by moving the dimension, but that's different from the opposite quadrant value. In my example the quadrant values are 60°, 120°, 60°, and 120°. Outer edge quadrant values (OE = 360° - IE) are much bigger, which are in my test case 300°, 240°, 300°, and 240°, respectively. So, there are actually 8 possible angle dimensions (outer edge OE and inner edge IE for every quadrant) for the crossing centerlines, of which I can produce angular dimensions to 4 cases. This can be done by selecting the centerlines in different order (2 choices), and by selecting inner or outer edges for the angular dimensions (also 2 choices). In order to cover all the choices, it should somehow be possible to select on which side of the intersection the arrows are drawn in the crossing centerlines case. Unfortunately, dragging the dimension on the other side of the apex is already reserved for the OE/IE selection, so some other selection mechanism would be needed. As you noted, this only seems to be needed for crossing lines, which was not possible earlier.

Thanks!
Post Reply