Links

Discussion about the development of the Assembly workbench.
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Links

Postby DeepSOIC » Sat May 06, 2017 2:14 pm

Well, I was about an order of magnitude off... but here we go!
Attachments
broken-cube.png
broken-cube.png (471.19 KiB) Viewed 999 times
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Links

Postby DeepSOIC » Sat May 06, 2017 2:20 pm

And here is a 1x1x1mm cube scaled up (Draft Clone) to the same net size. Passes geometry check.
Attachments
scaled cube.png
scaled cube.png (326.03 KiB) Viewed 995 times
wmayer
Site Admin
Posts: 15747
Joined: Thu Feb 19, 2009 10:32 am

Re: Links

Postby wmayer » Sat May 06, 2017 4:04 pm

The purpose of tolerances is to provide some margin against imprecise nature of floating-point numbers. And the precision of double is a constant fraction of the number's magnitude, about 2e-16.
But here we are talking about extreme differences in dimensions and I doubt these are the ranges where CAD is used in general. Btw, when working in the realm of 2e-16 then tolerances is the smallest problem. Here we reach the limitations of the viewer which internally works with floats and where the graphical representation is broken.

So again when working in the dimensions where CAD is usually used the tolerances shouldn't be automatically changed, IMO.
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Links

Postby DeepSOIC » Sat May 06, 2017 4:18 pm

wmayer wrote:So again when working in the dimensions where CAD is usually used
that's only up to the time someone decides to use FreeCAD to engineer a space elevator! :lol:
realthunder
Posts: 1541
Joined: Tue Jan 03, 2017 10:55 am

Re: Links

Postby realthunder » Sat May 06, 2017 6:38 pm

DeepSOIC wrote:Uniform scaling works fairly well, see implementation of Draft Clone
I am following Draft's way. I've pushed a few fixes, basically for this scaling thing and support for Body. I'll leave cyclic handling until every thing else is settled first. Please check it out.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Links

Postby DeepSOIC » Sun May 07, 2017 12:17 am

Tested a bit, so far works great.
I had a small problem when using Part-o-magic's Morph Container on a body which had an instance. The instance lost the link, and I got thos in report view:
created object
206.855 <Selection> T:\_vt\dev\PC\Qt\FreeCAD\FreeCAD-ellipse\src\Gui\Selection.cpp(969): Clear selection
container changed from instance_of_body to Module
entering Module
container changed from Module to instance_of_body
leaving Module
Can't find Origin for "Body"
Can't find Origin for "Body"
copying properties
BaseFeature
Target property missing: BaseFeature
Placement
Shape
ViewProvider update time: 0.012000 s
Shape tria info: Faces:11 Edges:24 Nodes:264 Triangles:228 IdxVec:172
replacing Body with Module within 15 objects...
replacing Body with Module within expressions in 15 objects...
replacing Body with Module within expressions in 0 spreadsheets...
deleted Body. container chain: instance_of_body
Coin error in SoSwitch::doAction(): whichChild 0 out of range -- switch node has no children! (warning will be printed once, but there might be more cases of this problem).
The "morph container" function is quite complex, and I'm not sure what exactly is the cause of the problem. I think we can leave it alone for now, at least until I find a way to reproduce it that is easier to diagnose.
realthunder
Posts: 1541
Joined: Tue Jan 03, 2017 10:55 am

Re: Links

Postby realthunder » Mon May 08, 2017 6:16 pm

DeepSOIC wrote:I really like that now selecting Part highlights everything in it. I also like the way we can now select higher and higher container the more times we click the object. But that seems to work only in hierarchies behind an App::Link. Would be great if you make it work with plain Part containers too.
I've just added support for hierarchical selection for plain geo groups. I didn't changed anything in App::Part itself, just the FC coin selection code.

There are other fixes. Most notably, when drag and drop children inside geo feature group, it no longer checks objects inside a link or another sub group. I seem to remember @ickby mentioned similar fixes inside his branch. I am not sure if this is the correct behavior. But with this fix, App::Part can now correctly drag and drop sub parts into or out of itself, and App::Link can correctly forward drag and drop handling to its linked group. I wonder why the original checking logic is not put inside addObject function.

I've also added an icon to PartDesign workbench to create link. If there is no selected object, click this icon will create an empty App::Link. Dropping any object onto it will link to that object. You may want to hold on CTRL while dropping if you don't want remove the object from its original parent. If there is a selected object and is derived from Part::Feature, then it creates a Part::Link to it, or else it is again an App::Link for other type of object.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Links

Postby DeepSOIC » Mon May 08, 2017 9:08 pm

realthunder wrote:I wonder why the original checking logic is not put inside addObject function.
Please note that in App::Container, I used this logic as universal, i.e. withdraw an object if it is in any other container before adding it. So you most likely went into conflict with my containers branch. I also added a different function, adoptObject, that does check if an object is in a container already, and do nothing if so. But I haven't tried to fix drag-and-drop. Instead I semi-fixed object duplication and copy-pasting.

It is stuck in PRs, and because of that I'm not sure if it's worth respecting it or not.
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Links

Postby DeepSOIC » Mon May 08, 2017 9:20 pm

I was about to roll out a mini assembly workbench based on your App::Link, also using Lattice and Attacher. But soon after I began coding I realized that attacher doesn't support geometry behind instances yet. I think I may still be able to do something, but it will be too inconvenient probably.

Additional problem is that attacher has built-in support for App::Plane and App::Line, which will not go through getSubObject method. So I don't know... Looks like attacher can't simply rely on getSubObject, and needs to support instance placement stack directly. These origin features are so annoying!! :evil:
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Links

Postby DeepSOIC » Mon May 08, 2017 9:40 pm

Maybe porting Assembly2 will be easier, hmm...