Assembly3 preview

Discussion about the development of the Assembly workbench.
realthunder
Posts: 1848
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Fri Jun 01, 2018 4:07 am

I have just finished upgrading the STEP import/export. In the process, Link/LinkGroup/Assembly Container gained new capability of context-dependent overriding of color and visibility. See the following screencast for the demonstration.

This BGA chip contains 900 balls, which are apparently of the same geometry. However, if this were a STEP file, the upstream FC importer will not respect the geometry data sharing. The uncompressed FC document size will be inflated to 12.8MiB. When using Link collapsed array mode (i.e. the array elements are not exposed as objects), the uncompress FC document size is only 174KiB, and the exported STEP file size of 561KiB.

In the screencast, I duplicated the entire BGA chip with another collapsed array, and override one of the ball's color, and another ball's visibility. The context-dependent overriding means that the override happens only on the specified selection path, the other instance is not affected. You can override individual face color, as well. But, unfortunately, current version of OCCT do not support exporting STEP with face override, only whole object color override, although the latest STEP document does allow it.

When you double the instance using the link array, the file size only increase by less than 1KiB, for both FC document and STEP.

Image
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
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Assembly3 preview

Postby bill » Fri Jun 01, 2018 12:31 pm

Brilliant work; clearly a fine example of what structured-programming can do in this environment. ADA-Ideals manifested at a whole new level.
Were you ever an Ada coder? Is this a STEP of a Video Graphics Processor/Display chip for your visor? :D :D :D :D :D :D
Yes, this would definitely be at the sixth smiley level.

Keep up the awesome results/solutions !

P.S. New appimage possibly?
realthunder
Posts: 1848
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Fri Jun 01, 2018 1:08 pm

bill wrote:
Fri Jun 01, 2018 12:31 pm
Brilliant work; clearly a fine example of what structured-programming can do in this environment. ADA-Ideals manifested at a whole new level.
Were you ever an Ada coder? Is this a STEP of a Video Graphics Processor/Display chip for your visor? :D :D :D :D :D :D
Yes, this would definitely be at the sixth smiley level.

Keep up the awesome results/solutions !

P.S. New appimage possibly?
Thanks for the appreciation. And yes, I am preparing for a new release.
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
realthunder
Posts: 1848
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Mon Jun 04, 2018 8:03 am

New version released.

Added a few requested features in Assembly3, summarized below,

* Support cylindrical surface in AxialAlignment and Colinear constraint
* Support yaw-pitch-roll angle setting in PlaneCoincident, PlaneAlignemtn, AxialAlignment and MultiParallel constraint
* Add quick mover tool, which allows you to move the object by simply move your mouse without dragging. Handy for bringing in objects out of sight.
* Support adding Origin to assembly
* Allow locking mover for fixed object

Please checkout the release notes for more details and screencasts.

I will be working on the Link document soon, and hopefully start the upstream merging discussion by the end of this week.
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
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Assembly3 preview

Postby triplus » Mon Jun 04, 2018 9:20 am

realthunder wrote:
Mon Jun 04, 2018 8:03 am
New version released.
Nice.
I have already solved this problem. The recompute logic is modified to collect dependency across documents if there are external links. And it works whether you make change in the external file, or in-place at the linking document.
Some discussions happened a while back but i can't remember the details. On things like how suitable the DAG approach is for assembly purposes and things like that.
What I can do, with some effort, is to support partial loading of document, so that only the linked objects, and all their dependent objects are loaded. With this, I envision the user will be able to build some files as library, say a file containing all kinds of bots and nuts. When opening an assembly, only the referenced objects are loaded.
Now, this is the hard part. And I don't think there is a universal meaning of "lightweight" here. Different objects have different requirements.
In short i am guessing Assembly 2 import feature alike. Where you can get geometry of some feature from another document. And the XLink is preserved. You don't have to have the origin document opened and history of the XLinked feature isn't important.
I will be working on the Link document soon, and hopefully start the upstream merging discussion by the end of this week.
Good to hear that.
User avatar
easyw-fc
Posts: 2928
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Postby easyw-fc » Mon Jun 04, 2018 10:12 am

realthunder wrote:
Mon Jun 04, 2018 8:03 am
New version released.

Added a few requested features in Assembly3, summarized below,

...
Please checkout the release notes for more details and screencasts.

I will be working on the Link document soon, and hopefully start the upstream merging discussion by the end of this week.
Hi @realthunder,
thank you for this update...

I noticed you also introduced:
Rework of STEP import/export to support geometric data sharing using App::Link, and color/visibility override (66d95842, 99ae7ede)
This is adding complexity to the A3 merging code that I fear could delay the merging.

I started to test your STEP implementation with some user case I made during the process to fine tuning Jean Marie STEP improvements.
I already noticed errors in Placement and Naming...

1) Would it possible to have an option to Save the structure using the old stable STEP export parser or the new A3 one?
2) Would it possible to add an other option to Import STEP inside the old stable Part hierarchy or inside the new A3 hierarchy structure?

That would keep the old STEP stable import/export structure also if A3 would be merged, and will add the option to start testing the new one method introduced by your branch.

I'm attaching a first sample file generating the errors I highlighted:
as1-ac-214-moved.FCStd
(54.32 KiB) Downloaded 20 times
Maurice
realthunder
Posts: 1848
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Mon Jun 04, 2018 11:25 am

easyw-fc wrote:
Mon Jun 04, 2018 10:12 am
I started to test your STEP implementation with some user case I made during the process to fine tuning Jean Marie STEP improvements.
I already noticed errors in Placement and Naming...

1) Would it possible to have an option to Save the structure using the old stable STEP export parser or the new A3 one?
2) Would it possible to add an other option to Import STEP inside the old stable Part hierarchy or inside the new A3 hierarchy structure?

That would keep the old STEP stable import/export structure also if A3 would be merged, and will add the option to start testing the new one method introduced by your branch.

I'm attaching a first sample file generating the errors I highlighted:
as1-ac-214-moved.FCStd

Maurice
I normally wouldn't replace code of others like that. But in this particular case, I feel that the concepts introduced by STEP documents offers some good explanation of the motivation of my Link. I didn't add any A3 stuff in STEP import/export. I am only using stuff in the core that I've changed. There is even a parameter setting to use back App::Part as the main container.

I have somewhat identified the cause of the problem of your attached file, and it is not in the import code. It is when Part.getShape() build the component from App::Part object, and calls OCC BRepBuilderAPI_MakeTransform to transform the shape, it somehow does not change the shape Location. I'll fix it shortly.

Please, send me more files for testing. I'm sure I can sort out most of the bugs before merging discussion going through. I think the discussion will most likely focus on API changes, and why are those changes needed, and I plan to use STEP as an argument.
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
realthunder
Posts: 1848
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Postby realthunder » Mon Jun 04, 2018 12:45 pm

easyw-fc wrote:
Mon Jun 04, 2018 10:12 am
I'm attaching a first sample file generating the errors I highlighted:
I have fixed the problem. Before releasing a bug fix version, I'd like to test more. I remember you were saying you are preparing for a STEP test suite in the other thread. Any more files for me to test?
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
easyw-fc
Posts: 2928
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Postby easyw-fc » Mon Jun 04, 2018 12:57 pm

realthunder wrote:
Mon Jun 04, 2018 11:25 am
I didn't add any A3 stuff in STEP import/export.
But I see that a hierarchy comes up into an Assembly container and not, as before, into a Part hierarchy.
realthunder wrote:
Mon Jun 04, 2018 11:25 am
I am only using stuff in the core that I've changed. There is even a parameter setting to use back App::Part as the main container.
that would be very useful to check the importing/exporting method side by side
As I mentioned before, it would be very useful to have an option to export with old method and to import also with old method.
It could be in the Preferences, and better if this could be addressed by python ;)
realthunder wrote:
Mon Jun 04, 2018 11:25 am
Please, send me more files for testing.
As I sent you before, there are many STEP files at the following links
easyw-fc wrote:
Mon May 14, 2018 9:27 am
Hi @realthunder,
if you want to make some test here you can find some STEP files generated from different SW and with or without hierarchy.
https://www.cax-if.org/library/index.html

here a test file with hierarchy:
https://www.cax-if.org/library/as1-oc-214.zip
https://www.cax-if.org/library/as1-pe-203.zip
https://www.cax-if.org/library/as1-tu-203.zip

and here a file with external references (similar to what it could be done with your 'Links' pointing to external files)
https://www.cax-if.org/library/s1-c5-214.zip
https://www.cax-if.org/library/s1-pe-214.zip
https://www.cax-if.org/library/s1-tu-203.zip

Hierarchy is already well supported by FreeCAD ATM.
External references are supported only when importing the file, but are not implemented when exporting.
https://www.cax-if.org/documents/rec_pr ... ef_v21.pdf
An other STEP file that had issues was this (and in fact it has issue now with A3 implementation)
https://grabcad.com/library/ur10-step-1

The main improvements and related issues can be found at here:
https://forum.freecadweb.org/viewtopic.php?t=23371
easyw-fc wrote:
Tue Jul 11, 2017 10:39 am
I'm going to resume the most interesting new features added:
1) STEP file size
following this thread
https://forum.freecadweb.org/viewtopic. ... 85#p142700
the file size of STEP files can be now reduced up to 5 times in many cases... this is an old known problem that now has been solved!
2) STEP file loading time
following this thread
https://forum.freecadweb.org/viewtopic. ... ng#p158225
the loading time has been improved so much that STEP file loading now is faster than some commercial CADs
3) STEP file handling
following this thread
https://forum.freecadweb.org/viewtopic. ... 90#p159741
using VBO and OpenGl FreeCAD is now able to manage extremely complex STEP files, having frames per seconds similar to best commercial CADs
4) STEP import
following this thread
https://forum.freecadweb.org/viewtopic. ... 36#p156821
the STEP importer now has a hierarchy when present in the file itself, creating App::Part containers perfect for Assembly structure
Finally FreeCAD integrates a hierarchy when reading STEP files, instead of a FLAT structure, as it was till now.
5) STEP export
following this thread
https://forum.freecadweb.org/viewtopic.php?f=17&t=23368
the STEP exporter now can save a STEP file conserving the hierarchy as present when loaded.
Using App::Part containers it is also possible to create an Assembly structure to be exported as single hierarchical STEP file as in commercial CADs.

The main purpose and criticality with STEP format is that STEP is for CAD interchange and not for simple using inside FreeCAD, as its proprietary format can be.

Then the STEP topic involves not only OCC but the interoperability with commercial CADs.
Jean Marie had the opportunity to test his code refactoring also on proprietary sw ... this I think, should be a must for the STEP new merging code.

A solid but free (only windowze) CAD sw for STEP reading (not free for writing) is Design Spark Mechanical.
An other option, by OpenCascade, is CAD Assistant

Unfortunately no easy option for testing STEP with other commercial CADs, unless some of this community may jump in to help in deep testing.

Sorry for this long post, I'm not against the new refactoring, I'm only pointing out it could be a complex run.

Maurice

EDIT:
PS I also have two small 'left' feature by Jean Marie implementation, that I'm going to ask if you can fix, after these :D
User avatar
easyw-fc
Posts: 2928
Joined: Thu Jul 09, 2015 9:34 am

Re: Assembly3 preview

Postby easyw-fc » Mon Jun 04, 2018 1:15 pm

realthunder wrote:
Mon Jun 04, 2018 12:45 pm
I have fixed the problem.
woah that was fast :D
Please still consider to add an option to import/export in old mode...
realthunder wrote:
Mon Jun 04, 2018 12:45 pm
Before releasing a bug fix version, I'd like to test more. I remember you were saying you are preparing for a STEP test suite in the other thread. Any more files for me to test?
a part the ones above,
here an other difficult one:
Kunda1 wrote:
Tue Jul 11, 2017 10:21 pm
Can you take a look at issue #2369 testing the new commits?
arietta7z
there is just a strange issue related at the finishing loading time, which is much longer for this file compared to others in FC0.17-0.18
and another one that has issue depending on preference configuration
https://forum.freecadweb.org/viewtopic. ... 10#p228253

I have something more (I just began to scratch the surface), but I cannot directly upload those because there are some proprietary models coming from 'open' but not free libraries.