Woodworking - getDimensions

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

dprojects wrote: Thu Nov 18, 2021 10:13 pm I don't know what is going on there. The Pads (Unnamed objects in folders) have only two properties Length and Length2. The other Unnamed objects have no properties, no dimensions. I have no idea how you create the Spreadsheet table, values and names.

What you want to calculate there exactly?
I just want a part list, a BOM would be very nice. I will look into some other scripts that might work. I especially liked yours because it is mature and has a very nice output.
Even an interface to for example OpenBom would be very nice.
I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

Petert wrote: Fri Nov 19, 2021 6:25 pm I just want a part list, a BOM would be very nice. I will look into some other scripts that might work. I especially liked yours because it is mature and has a very nice output.
Even an interface to for example OpenBom would be very nice.
Nice to hear that, however I still don't know how you created the Spreadsheet. The Unnamed objects in Pads folder have only 2 dimensions Length and Length2 all others cannot be calculated. Give me more details about the Spreadsheet creation, maybe I will help.
btw: I don't know what you mean by BOM or OpenBom.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

dprojects wrote: Fri Nov 19, 2021 6:35 pm
Petert wrote: Fri Nov 19, 2021 6:25 pm I just want a part list, a BOM would be very nice. I will look into some other scripts that might work. I especially liked yours because it is mature and has a very nice output.
Even an interface to for example OpenBom would be very nice.
dprojects wrote: Fri Nov 19, 2021 6:35 pm Nice to hear that, however I still don't know how you created the Spreadsheet.
There is a workbench, called Spreadsheet.
https://wiki.freecadweb.org/Spreadsheet_Workbench

You can add sheets to your file and refer to values in cells, you can give the cells easy names so it all becomes easier. You use the values in expressions.
https://wiki.freecadweb.org/Expressions

dprojects wrote: Fri Nov 19, 2021 6:35 pm The Unnamed objects in Pads folder have only 2 dimensions Length and Length2 all others cannot be calculated.
All the pads are depended on a sketch, the sketch has the x and y values, the pad adds the z value (very simplistically explained) Most values in the sketches and the Pad's are defined and calculated in the spreadsheet, that way everything behaves parametric.
dprojects wrote: Fri Nov 19, 2021 6:35 pm Give me more details about the Spreadsheet creation, maybe I will help.
I hope the above will get you started.
dprojects wrote: Fri Nov 19, 2021 6:35 pm btw: I don't know what you mean by BOM or OpenBom.
BOM stands for bill of materials.
There are some attempts in FreeCAD to make a module, for example https://wiki.opensourceecology.org/wiki ... _Generator and https://forum.freecadweb.org/viewtopic.php?t=51174

OpenBom is an online suite to "Manage Parts, Documents, Bill of Materials, Vendors, and Purchases"
I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

Petert wrote: Fri Nov 19, 2021 7:00 pm All the pads are depended on a sketch, the sketch has the x and y values, the pad adds the z value (very simplistically explained) Most values in the sketches and the Pad's are defined and calculated in the spreadsheet, that way everything behaves parametric.
OK, so in Spreadsheet you have something like that:

Code: Select all

kast dikte	18
	
kastHoogte	2400
kastBreedte	1015
kastDiepte	500
	
	
linksHoogte	=kastHoogte
linksDikte	=B3
linksDiepte	=kastDiepte
	
rechtsHoogte	=B10
rechtsDikte	=linksDikte
rechtsDiepte	=B12
	
plankDikte	18
	
plankBovenHoogte	300
plankMiddenHoogte	=700 - plankBenedenHoogte
plankBenedenHoogte	300
explain me the values and names there. How you calculate them in relation to the x, y, z values of Pads?

btw: The BOM is new thing to me. Looks interesting but for furniture design purposes it is too complicated to me. For advanced machine production, this might be useful. As I mentioned I like simple things that works. Cube is simple and works for furniture design very well and is very quick, it takes only several minutes to create simple furniture from Cubes. With sketches and pads the furniture is much more detailed for sure but it is too complicated to handle later. I don't design furniture to print 3D model and view it in details. I use FreeCAD for design furniture mostly to get chipboards dimensions to cut in the store later.

EDIT: English translation:

Code: Select all

case thickness 18

cabinet height 2400
cabinet width 1015
cabinet depth 500

left Height = cabinet Height
left Thickness =B3
left Depth = cabinet Depth

right Height =B10
right Thickness = left Thickness
right Depth =B12

shelf Thickness 18

shelf Top Height 300
shelf Middle Height =700 - shelf Bottom Height
shelf Bottom Height 300
but this need to be calculated from x, y, z, where to find all needed values for the calculation? if you want to write any program you have to keep some rules with naming, directory structure and especially properties (dimensions). This cannot be totally random.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

dprojects wrote: Fri Nov 19, 2021 9:12 pm
Petert wrote: Fri Nov 19, 2021 7:00 pm All the pads are depended on a sketch, the sketch has the x and y values, the pad adds the z value (very simplistically explained) Most values in the sketches and the Pad's are defined and calculated in the spreadsheet, that way everything behaves parametric.
OK, so in Spreadsheet you have something like that:

Code: Select all

kast dikte	18
	
kastHoogte	2400
kastBreedte	1015
kastDiepte	500
explain me the values and names there. How you calculate them in relation to the x, y, z values of Pads?
You just don't. I model the objects around the origin. Positions are relative to that origin. Pads are just a thickness, nothing more.
dprojects wrote: Fri Nov 19, 2021 9:12 pm but this need to be calculated from x, y, z, where to find all needed values for the calculation?
Well, as I said my designs are all based on sketches, sketches have an origin in space. I make sure all sketches have a common origin and can 'draw' and calculate positions that way. It's not magic, once you tried it you will never use the Part workbench again.
dprojects wrote: Fri Nov 19, 2021 9:12 pm if you want to write any program you have to keep some rules with naming, directory structure and especially properties (dimensions). This cannot be totally random.
I know, I am used to naming conventions. There are some ways to use the Arch workbench to give an object some meaningful properties, same goes goes for material properties. But since this is a work in progress I didn't bother with that.
dprojects wrote: Fri Nov 19, 2021 9:12 pm btw: The BOM is new thing to me. Looks interesting but for furniture design purposes it is too complicated to me. For advanced machine production, this might be useful. As I mentioned I like simple things that works. Cube is simple and works for furniture design very well and is very quick, it takes only several minutes to create simple furniture from Cubes. With sketches and pads the furniture is much more detailed for sure but it is too complicated to handle later. I don't design furniture to print 3D model and view it in details. I use FreeCAD for design furniture mostly to get chipboards dimensions to cut in the store later.
One example of using a BOM is to autogenerate a cutlist. There is software that can use that cutlist to align your parts on a plywood sheet so you can have the most economical way to get parts out of a sheet. And that is just one example of how you can use a BOM or derivative. You could generate a partlist for just the hardware for example.
I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

Code: Select all

case thickness 18
This can be done by macro by getting the minimum property value.

Code: Select all

cabinet height 2400
cabinet width 1015
cabinet depth 500
The problem is that script, macro or any program is not a human and it not see the 3D model. Macro don't know what you want to do with all the elements, how they are connected to each other. You need to know neighbor for each element. It would be very nice to trace common edges and build 3D model and determine the overall dimensions of the furniture but it is very hard way to do it well - totally not worth for cutting chipboard purposes.

Code: Select all

left Height = cabinet Height
left Thickness =B3
left Depth = cabinet Depth
right Height =B10
right Thickness = left Thickness
right Depth =B12
shelf Top Height 300
shelf Middle Height =700 - shelf Bottom Height
shelf Bottom Height 300
The same here. Macro not see the 3D model, only separate elements. I don't have access to common edges from macro level to build 3D model and determine global sizes.

ISSUE: You need exact directory structure and naming convention to make this trick possible.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

dprojects wrote: Sat Nov 20, 2021 4:16 pm

Code: Select all

case thickness 18
This can be done by macro by getting the minimum property value.

Code: Select all

cabinet height 2400
cabinet width 1015
cabinet depth 500
The problem is that script, macro or any program is not a human and it not see the 3D model. Macro don't know what you want to do with all the elements, how they are connected to each other. You need to know neighbor for each element. It would be very nice to trace common edges and build 3D model and determine the overall dimensions of the furniture but it is very hard way to do it well - totally not worth for cutting chipboard purposes.

Code: Select all

left Height = cabinet Height
left Thickness =B3
left Depth = cabinet Depth
right Height =B10
right Thickness = left Thickness
right Depth =B12
shelf Top Height 300
shelf Middle Height =700 - shelf Bottom Height
shelf Bottom Height 300
The same here. Macro not see the 3D model, only separate elements. I don't have access to common edges from macro level to build 3D model and determine global sizes.

ISSUE: You need exact directory structure and naming convention to make this trick possible.
You are ovethinking this. Every body is a part. No need to see the 3d structure.
Can you supply me with example how you got those properties?
dprojects wrote: Sat Nov 20, 2021 4:16 pm ISSUE: You need exact directory structure and naming convention to make this trick possible.
This is true and is the same for all the BOM systems I use. But since the BOM was an afterthought I didn't follow these rules in this example.
I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

I know what you asking for. You want macro acting like a human, see 3D model and calculate dimensions.
From macro programming level you see only bunch of objects, even not sorted. You can only go thru each object and check the object type, get any field but you don't see common edge with other objects, how they are connected to each other.

This is what you have: https://wiki.freecadweb.org/Category:API
Last edited by dprojects on Sat Nov 20, 2021 8:34 pm, edited 2 times in total.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

dprojects wrote: Sat Nov 20, 2021 6:40 pm I know what you asking for. You want macro acting like a human, see 3D model and calculate dimensions.
No, not at all.
dprojects wrote: Sat Nov 20, 2021 6:40 pm From macro programming level you see only bunch of objects, even not sorted. You can only go thru each object and check the object type, get any field but you don't see common edge with other objects, how they are connected to each other.
Why would I care about an edge? I am not sure you really understand what is requested.
dprojects wrote: Sat Nov 20, 2021 6:40 pm This is what you have: https://wiki.freecadweb.org/Category:API
I know of the api. This is my starting point https://wiki.freecadweb.org/index.php?t ... cro_FCInfo

Thanks for your effort, I saw some attempts at making a real BOM functionality for FreeCAD and have made inquiries with them.
I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
Post Reply