Changing Bounding Box font size, alternative methods to get model size

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
User avatar
jmeile
Posts: 15
Joined: Sat Oct 12, 2019 11:45 am

Changing Bounding Box font size, alternative methods to get model size

Post by jmeile »

Dear all

Currently I'm starting to use FreeCAD and it is really nice. Right now, I'm trying to change the font size of the bounding box dimensions. Most of the posts I have found talk about the Sketcher, Draft, and other Workbenches. However, it seems that the bounding box isn't part of any Workbench. Is there any way of change the font size? It is really small; even if I zoom the view (see the screenshot).

By the way, If you see my screenshot, you will see that I had to join all parts to get the whole Bounding Box. Is there any other way?

I found a couple of Macros, but most of them are nonexistent. The one I'm using now is the FCInfo, which does a good job; however, I think it might be better to be able to change the font size. Is this possible?

Thanks in advanced

Best regards
Josef
Attachments
bounding_box.jpg
bounding_box.jpg (769.86 KiB) Viewed 868 times
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Changing Bounding Box font size, alternative methods to get model size

Post by vocx »

jmeile wrote: Sat Oct 12, 2019 12:05 pm ... I'm trying to change the font size of the bounding box dimensions. ...
But why? What do you want to achieve?

A bounding box is an attribute of the geometrical object that you see on the screen. As you saw, the property editor has this option to display it on the 3D view, but that's it. The bounding box is not part of the object itself, or isn't configurable.

Instead of fusing the objects, you can also use Part MakeCompound, so that the individual shapes aren't fused together, just placed together in a type of group.

The resulting object, which you can obtain from the selection view, has this information in its Shape attribute.

Code: Select all

>>> obj.Shape.BoundBox
BoundBox (-2, -1.98542, 0, 10, 10, 10)
>>> obj.Shape.BoundBox.XMin
-2.0
>>> obj.Shape.BoundBox.YMin
-1.9854177481961086
>>> obj.Shape.BoundBox.ZMin
0.0
>>> obj.Shape.BoundBox.XMax
10.0
>>> obj.Shape.BoundBox.YMax
10.0
>>> obj.Shape.BoundBox.ZMax
10.0
If you want you can place further annotations with Draft Text. Since a Text is a real object, you can control its display size, and make it bigger or smaller as you want.

Code: Select all

obj_text.ViewObject.FontSize = 1000
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
jmeile
Posts: 15
Joined: Sat Oct 12, 2019 11:45 am

Re: Changing Bounding Box font size, alternative methods to get model size

Post by jmeile »

Hi Vocx

Thanks for your reply.
But why? What do you want to achieve?
I'm going to 3D print those parts, so, I needed to know if the dimensions of the whole parts are the same as in the stl file.

A bounding box is an attribute of the geometrical object that you see on the screen. As you saw, the property editor has this option to display it on the 3D view, but that's it. The bounding box is not part of the object itself, or isn't configurable.
It would be nice that you could change the font size. Some people has been asked for this before. I don't know what's the point of putting those numbers on the model if you can't read them. Better to put only the lines and nothing else.

Instead of fusing the objects, you can also use Part MakeCompound, so that the individual shapes aren't fused together, just placed together in a type of group.
I tried that; however as soon as I join the shapes, they will get the same origin: (0, 0, 0), so, they will be overlapped together. See the screenshot. This is actually a problem I have: each time I make an operation on one part, ie: a cut or a fusion, the resulting shape will be added outside of that part. I solved then the problem by moving that result to the part again. Is there any way of having always all resulting shapes added to the parts automatically?

The resulting object, which you can obtain from the selection view, has this information in its Shape attribute.
Yes, I also saw a script in another post. I tried that and it works as your code; however, why to use a script if you could achieve in an easier way by showing the bounding box on the model itself?

Anyway, instead of adding a macro by myself, I guess I will use an existing one, the FCInfo macro, which does what I need. It is not as easy as just showing the Bounding box, but I guess I will have to live with that.

Best regards
Josef
Attachments
Shapes after "Make Compound"
Shapes after "Make Compound"
grouped_shapes.jpg (739.92 KiB) Viewed 829 times
Original parts
Original parts
original_parts.jpg (454.95 KiB) Viewed 829 times
noahk
Posts: 39
Joined: Mon Jan 11, 2021 8:59 pm

Re: Changing Bounding Box font size, alternative methods to get model size

Post by noahk »

I too would like to increase the size of the bounding box. There's a YouTube video showing how to center text on an object and it involves using those sizes. Perhaps an explanation of how to do this without using a bounding box would help.
Post Reply