Disconnected objects in 0.17 Python script
- grandcross
- Posts: 319
- Joined: Sun Oct 11, 2015 3:08 pm
- Contact:
Disconnected objects in 0.17 Python script
I'm generating a part that looks like this:
This is a usable object, but all the parts are disconnected. To export to an .STL I have to select all and export the result. I thought the problem was that I was building several pieces independently and then connecting them, so I reduced the macro to produce just one corner of the tower, as shown here:
The body tree looks like this however:
So, what am I doing wrong? I've looked at every example script I can find and tried many things but the results are always the same. I'm missing something pretty basic.
As I said, I can use what I have, but at this point this is a learning exercise for me.
This is a usable object, but all the parts are disconnected. To export to an .STL I have to select all and export the result. I thought the problem was that I was building several pieces independently and then connecting them, so I reduced the macro to produce just one corner of the tower, as shown here:
The body tree looks like this however:
So, what am I doing wrong? I've looked at every example script I can find and tried many things but the results are always the same. I'm missing something pretty basic.
As I said, I can use what I have, but at this point this is a learning exercise for me.
- Attachments
-
LES_Tower.py
- (9.18 KiB) Downloaded 51 times
- grandcross
- Posts: 319
- Joined: Sun Oct 11, 2015 3:08 pm
- Contact:
Re: Disconnected objects in 0.17 Python script
Whoops! Forgot the system info...
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10611 (Git)
Build type: Release
Branch: debugging
Hash: 44a9ecd25f27ec3efe52c9de9c95ef2b3e19dd17
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
I'm currently working from a repository build that I update semi-regularly. So this has gone through a couple of software build iterations.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10611 (Git)
Build type: Release
Branch: debugging
Hash: 44a9ecd25f27ec3efe52c9de9c95ef2b3e19dd17
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
I'm currently working from a repository build that I update semi-regularly. So this has gone through a couple of software build iterations.
- DeepSOIC
- Veteran
- Posts: 7900
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Disconnected objects in 0.17 Python script
Hi!
Body doesn't fuse stuff together. Moreover, Body is supposed to accept only PartDesign stuff. Use Part Fusion instead.
You may also be interested in Part-o-magic ShapeGroup, which can fuse objects.
Body doesn't fuse stuff together. Moreover, Body is supposed to accept only PartDesign stuff. Use Part Fusion instead.
You may also be interested in Part-o-magic ShapeGroup, which can fuse objects.
Re: Disconnected objects in 0.17 Python script
nothing... just ATM Part pf Part Design (App::Part) doesn't support to make a simple copy of the App:Part structure like in Part simple copygrandcross wrote:So, what am I doing wrong?
here you can find a related discussion
https://forum.freecadweb.org/viewtopic. ... 98#p160304
https://forum.freecadweb.org/viewtopic. ... 20#p160416
I've done a ticket
https://www.freecadweb.org/tracker/view.php?id=2905
Still unfortunately there is no one assigned to this issue
- grandcross
- Posts: 319
- Joined: Sun Oct 11, 2015 3:08 pm
- Contact:
Re: Disconnected objects in 0.17 Python script
Thanks guys.
You've both missed what I'm asking for and hit it exactly
So, Part doesn't work with PartDesign. I was missing that bit but I don't really want to know how to force them to fit together. I can get what I want from what I have now. What I'm really looking for is how I should be doing this with PartDesign. I assume it's possible, but at this point I'm not seeing how.
Are there any good examples available of doing this with more than a simple box?
You've both missed what I'm asking for and hit it exactly

So, Part doesn't work with PartDesign. I was missing that bit but I don't really want to know how to force them to fit together. I can get what I want from what I have now. What I'm really looking for is how I should be doing this with PartDesign. I assume it's possible, but at this point I'm not seeing how.
Are there any good examples available of doing this with more than a simple box?
- DeepSOIC
- Veteran
- Posts: 7900
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Disconnected objects in 0.17 Python script
Then you have to create PartDesign features from script, essentially copy-parting most of the stuff that is printed to console when you create it through GUI. Which isn't very practical IMO. Why exactly do you have to do it with involving PartDesign?grandcross wrote:What I'm really looking for is how I should be doing this with PartDesign.
Re: Disconnected objects in 0.17 Python script
Honestly, it would be very hard to create this model using a pure PartDesign workflow, and not very efficient.
A PartDesign Body can only contain one single, contiguous solid. But each leg and strut is its own solid, so this would require as many separate Bodies. Then you would have to create PartDesign Booleans to fuse all the Bodies into one.
Also, considering the symmetrical nature of this model, it would make sense to use of Part Mirror and Draft Array tools.
A PartDesign Body can only contain one single, contiguous solid. But each leg and strut is its own solid, so this would require as many separate Bodies. Then you would have to create PartDesign Booleans to fuse all the Bodies into one.
Also, considering the symmetrical nature of this model, it would make sense to use of Part Mirror and Draft Array tools.
- grandcross
- Posts: 319
- Joined: Sun Oct 11, 2015 3:08 pm
- Contact:
Re: Disconnected objects in 0.17 Python script
I don't. At this point I have something that gives me the results I need. This is just so I know how for future projects.DeepSOIC wrote:Why exactly do you have to do it with involving PartDesign?
In particular, for this structure knowing the locations of the end points for each of the struts involves calculations since everything is at an angle. I could do all this on paper, and transfer that to the design through the GUI, but really that is what scripting is for. I anticipate doing similar projects in the future, as well as sharing this with friends who may reuse it so I'd like it to be as clean, simple, and complete as possible.
- grandcross
- Posts: 319
- Joined: Sun Oct 11, 2015 3:08 pm
- Contact:
Re: Disconnected objects in 0.17 Python script
I'm going to have to ponder this for a little bit, but ultimately this may be the answer I was after. Thanks.NormandC wrote:Honestly, it would be very hard to create this model using a pure PartDesign workflow, and not very efficient.
A PartDesign Body can only contain one single, contiguous solid. But each leg and strut is its own solid, so this would require as many separate Bodies. Then you would have to create PartDesign Booleans to fuse all the Bodies into one.
Also, considering the symmetrical nature of this model, it would make sense to use of Part Mirror and Draft Array tools.
- grandcross
- Posts: 319
- Joined: Sun Oct 11, 2015 3:08 pm
- Contact:
Re: Disconnected objects in 0.17 Python script
As I'm thinking this through, this is more and more a serious limitation.
I can create my part using the Part methodology. But what about when I need to combine it with pieces composed using Part Design? For example, this piece will be stand alone because of its size. Ultimately it will be combined with other pieces to make a larger model. Here's an example using earlier versions as an assembly:
Now, in my case this works. Because of the size limitations of my printer, I have to do these as separate pieces. But what if I were making a smaller version? The lower capsule portion I'm building in Part Design because there are a lot of details I'm adding (not shown in this version). If I create my tower using the Part flow, and then try to add a piece using Part design, the two remain separate.
Trying to combine them is impossible. They are two separate and distinct entities, even though they're part of the same model.
(Before you ask, you also don't seem to be able to export using the assembly. I tried. This was the result. It's always possible I was doing something completely wrong, but...)
So, what is the intended workflow for this? Is there one?
I can create my part using the Part methodology. But what about when I need to combine it with pieces composed using Part Design? For example, this piece will be stand alone because of its size. Ultimately it will be combined with other pieces to make a larger model. Here's an example using earlier versions as an assembly:
Now, in my case this works. Because of the size limitations of my printer, I have to do these as separate pieces. But what if I were making a smaller version? The lower capsule portion I'm building in Part Design because there are a lot of details I'm adding (not shown in this version). If I create my tower using the Part flow, and then try to add a piece using Part design, the two remain separate.
Trying to combine them is impossible. They are two separate and distinct entities, even though they're part of the same model.
(Before you ask, you also don't seem to be able to export using the assembly. I tried. This was the result. It's always possible I was doing something completely wrong, but...)
So, what is the intended workflow for this? Is there one?