Sketcher: rotation of a simple rectangle with large dimensions does not work, what to do?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
JochenB
Posts: 17
Joined: Wed Jun 29, 2022 7:39 pm

Sketcher: rotation of a simple rectangle with large dimensions does not work, what to do?

Post by JochenB »

Hello FreeCad forum.

I think I've pushed the Sketcher to its limits. I can no longer rotate a simple shape like a rectangle once I set length constraints. Is this a bug? What can I do?

The rectangle in the example is 99.6 x 36 m. Originally it was very far away from the origin (approx. x=362 km y=5,620 km), because I had put it on an imported terrain model with the corresponding geo-coordinates.

In the German forum I had presented my complete example, which had other problems in addition to the problem described, which I was able to solve thanks to user @chrisb. What remains is this sketch with the rotating problem.
(See Beschränkungen bringen Sketcher an der Grenze? (Invalid constraint index))

Chrisb suspected that the Sketcher has problems with the large values. He recommended other solver settings, which unfortunately didn't work for me. He gave me the hint to involve @abdullah as he knows the sketcher very well.

In the linked file I narrowed down the problem to a simple rectangle. I deleted everything else. It is no longer recognizable (to me) that the rectangle originally is/was so far away from the origin:

example large dimensions.FCStd
(4.17 KiB) Downloaded 12 times

Normally I can rotate the rectangle by grabbing a corner point with the mouse and moving it. In the example this fails. The following message appears in the report view:

Code: Select all

23:15:25 Traceback (most recent call last):
File "<string>", line 1, in <module>
<class 'ValueError'>: Not able to move point with the id and type: (1, 2)
23:15:25 App.getDocument('example_large_dimensions').getObject('Sketch005').movePoint(1,2,App.Vector(362596704.000000,5620973568.000000,0),0)
23:15:25 Drag point: Not able to move point with the id and type: (1, 2)
If I try to rotate the rectangle by 10° using an angle constraint, the following error message appears:

"Invalid constraint index: 9"

The following appears in the report view:

Code: Select all

23:21:46 Traceback (most recent call last):
File "<string>", line 1, in <module>
<class 'ValueError'>: Invalid constraint index: 9
23:21:46 App.getDocument('example_large_dimensions').getObject('Sketch005').setDatum(9,App.Units.Quantity('190.000000 deg'))
The original, not narrowed file may be helpful. I haven't deleted anything in this file yet. There are terrain models, an original track plan as an image and my attempt to draw it. You can find the file here: Wilischthal Station.FCStd. Here it is the "Grundplatten" sketch where I can no longer rotate the elements.

Thanks,
Jochen

FreeCAD version info:

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
Locale: German/Germany (de_DE)
Installed mods: 
  * Trails 2022.1.0
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Sketcher: rotation of a simple rectangle with large dimensions does not work, what to do?

Post by Shalmeneser »

If I move the rectangle near the origin, no problem to move the rectangle.

(select a vertex, Z,O (=Sketcher_SelectOrigin), C (= Sketcher_ConstrainCoincident)
(suppress this coincidence)
JochenB
Posts: 17
Joined: Wed Jun 29, 2022 7:39 pm

Re: Sketcher: rotation of a simple rectangle with large dimensions does not work, what to do?

Post by JochenB »

Hello Shalmeneser,
Shalmeneser wrote: Wed Aug 17, 2022 9:50 pm If I move the rectangle near the origin, no problem to move the rectangle.
Thanks, that works! I had already tried moving the entire sketch, ie square and sketch origin together. That didn't do anything.

However, the rectangle is then no longer in the right place. In the original file it is on a terrain model that is aligned with the real geo-coordinates. The square is now in the origin of the geo-coordinates and not in the right place in the terrain model.

Thanks to your hint I found the solution. The origin of the sketch and the origin of the entire file do not have to be identical. So I moved the rectangle to the origin as you described. I then pushed the entire sketch back the same distance. To do this, I set the X and Y values in the properties of the sketch under 'Placement'. So everything works again and for me the problem is solved. Thank you very much for the crucial hint!

In principle, however, it would be desirable if Sketcher could also handle large values. Alternatively, there should be an error message telling you to move the entities closer to the origin of the sketch. So the problem is solved for me, but it's still not ideal in principle.
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Sketcher: rotation of a simple rectangle with large dimensions does not work, what to do?

Post by Shalmeneser »

356 km ??? This program is not for constructing countries.

You can move the body.
You can move the sketch relativaly to the body origin.
You can move the inside of sketch relativaly to the sketch origin.

It's always easier when you use origin and axes.
Bance
Veteran
Posts: 4185
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Sketcher: rotation of a simple rectangle with large dimensions does not work, what to do?

Post by Bance »

Check the Trails WB there are known problems with large distances....
Post Reply