Questions on using experimental Assembly module

Discussion about the development of the Assembly workbench.
nonlimited
Posts: 14
Joined: Thu Dec 01, 2011 10:00 pm

Questions on using experimental Assembly module

Postby nonlimited » Sun Sep 22, 2013 7:27 pm

Hi!

I have problems assembling parts with curved shapes, eg. centering a cylinder into a hole. How can I achieve this?
I appended an example file, where you see what I mean.

By stupidly trying contraints, that *might* somehow work, I'm encountering a crash.
For instance, try make the two upper edges (circles) of hole and cylinder be parallel (||).

Here is the backtrace

Code: Select all

#0  0x0000000000776f64 in ?? ()
#1  0x00007fffcdb5aff7 in getConstraintPrerequisits(Assembly::ItemAssembly**, Assembly::ConstraintGroup**) () from /usr/local/freecad/lib/AssemblyGui.so
#2  0x00007fffcdb5c922 in CmdAssemblyConstraintOrientation::activated(int) () from /usr/local/freecad/lib/AssemblyGui.so
#3  0x00007ffff74e7c33 in Gui::Command::invoke(int) () from /usr/local/freecad/lib/libFreeCADGui.so
#4  0x00007ffff74decc3 in Gui::Action::onActivated() () from /usr/local/freecad/lib/libFreeCADGui.so
#5  0x00007ffff74e3dea in Gui::Action::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/local/freecad/lib/libFreeCADGui.so
#6  0x00007ffff4f120ef in QMetaObject::activate (sender=sender@entry=0x1cfb210, m=m@entry=0x7ffff610b7a0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffbf10) at kernel/qobject.cpp:3539
#7  0x00007ffff5663152 in QAction::triggered (this=this@entry=0x1cfb210, _t1=false) at .moc/release-shared/moc_qaction.cpp:277
#8  0x00007ffff5664580 in QAction::activate (this=0x1cfb210, event=<optimized out>) at kernel/qaction.cpp:1257
#9  0x00007ffff5a28b5f in QAbstractButtonPrivate::click (this=this@entry=0x1d28a30) at widgets/qabstractbutton.cpp:530
#10 0x00007ffff5a28e0c in QAbstractButton::mouseReleaseEvent (this=0x1cfb370, e=0x7fffffffc980) at widgets/qabstractbutton.cpp:1123
#11 0x00007ffff5ae58ea in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:718
#12 0x00007ffff56b6a89 in QWidget::event (this=0x1cfb370, event=0x7fffffffc980) at kernel/qwidget.cpp:8375
#13 0x00007ffff56698ec in QApplicationPrivate::notify_helper (this=this@entry=0x813080, receiver=receiver@entry=0x1cfb370, e=e@entry=0x7fffffffc980) at kernel/qapplication.cpp:4567
#14 0x00007ffff566ca33 in QApplication::notify (this=<optimized out>, receiver=0x1cfb370, e=0x7fffffffc980) at kernel/qapplication.cpp:4110
#15 0x00007ffff74777d1 in Gui::GUIApplication::notify(QObject*, QEvent*) () from /usr/local/freecad/lib/libFreeCADGui.so
#16 0x00007ffff4efd63e in QCoreApplication::notifyInternal (this=0x7fffffffd800, receiver=receiver@entry=0x1cfb370, event=event@entry=0x7fffffffc980) at kernel/qcoreapplication.cpp:946
#17 0x00007ffff566f933 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#18 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x1cfb370, event=event@entry=0x7fffffffc980, alienWidget=alienWidget@entry=0x1cfb370, nativeWidget=nativeWidget@entry=0x1cc53c0, buttonDown=buttonDown@entry=0x7ffff6147308 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true)
    at kernel/qapplication.cpp:3178
#19 0x00007ffff56e4e54 in QETWidget::translateMouseEvent (this=this@entry=0x1cc53c0, event=event@entry=0x7fffffffd100) at kernel/qapplication_x11.cpp:4631
#20 0x00007ffff56e3e81 in QApplication::x11ProcessEvent (this=0x7fffffffd800, event=event@entry=0x7fffffffd100) at kernel/qapplication_x11.cpp:3746
#21 0x00007ffff570f042 in x11EventSourceDispatch (s=0x7b5e70, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#22 0x00007fffee791f05 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007fffee792248 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007fffee792304 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007ffff4f2c016 in QEventDispatcherGlib::processEvents (this=0x79d940, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#26 0x00007ffff570f13e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#27 0x00007ffff4efc38f in QEventLoop::processEvents (this=this@entry=0x7fffffffd4d0, flags=...) at kernel/qeventloop.cpp:149
#28 0x00007ffff4efc618 in QEventLoop::exec (this=this@entry=0x7fffffffd4d0, flags=...) at kernel/qeventloop.cpp:204
#29 0x00007ffff4f01cf6 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#30 0x00007ffff7472bcb in Gui::Application::runApplication() () from /usr/local/freecad/lib/libFreeCADGui.so
#31 0x0000000000408621 in main ()
But so far, great work!
Attachments
test.fcstd
(11.11 KiB) Downloaded 103 times
kwahooo
Posts: 204
Joined: Wed May 19, 2010 11:11 pm
Contact:

Re: Big merge day

Postby kwahooo » Sun Sep 22, 2013 9:12 pm

Use cylindrical surfaces instead curves/circles. If the video works look at 2:20.
ickby
Posts: 2922
Joined: Wed Oct 05, 2011 7:36 am

Re: Big merge day

Postby ickby » Mon Sep 23, 2013 7:03 am

kwahooo is right, currently circles are not supported yet, use cylindrical surfaces instead. I put it on my TODO list. I can't get anything usefule from the stack trace, but will try to reproduce it this evening. Thanks for sharing, it's always helpful to get multiple testers!

Nice video kawahoo!
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Big merge day

Postby project4 » Mon Sep 23, 2013 7:42 pm

Hi guys,

Finally I got my new SSD and had time to install Ubuntu 13.04 so I'm now able to compile the assembly stream.

But for now I'm facing a strange problem:
I've exported few of my parts created with 0.13 to STP format (with and without color behave the same).
I try to add those files to the assembly product and nothing happens...

Loading the STP files in part designer works ok, so I assume the STP files are good.
Beside the fact that STP with color still shown as gray object after loading it.

What am I doing wrong?
There is a red print with StackTrace that disapears pretty fast, is there a way to see the print in a log or something?

Another strange thing was to find out that there is no way to add FSstd file to assembly, arent you going to support you own format? :)

I'm impatiently waiting for the big merge to have a more stable version, so I could propose the FreeCAD to my customers.
The assembly stream version currently crashes alot, do you want me to report everything I find?

Thanks for the great work, I'm sure FreeCAD will rule in the 3D printing community, people there are striving for good free CAD alternative.
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Big merge day

Postby project4 » Mon Sep 23, 2013 7:52 pm

Oh, found the report view, here's the traceback message:
Traceback (most recent call last):
File "<string>", line 1, in <module>
<type 'exceptions.ImportError'>: No module named AssemblyLib
Stack Trace: Traceback (most recent call last):
File "<string>", line 1, in <module>

Do I have something wrong with my compilation?
Why can't it find the AssemblyLib?
ickby
Posts: 2922
Joined: Wed Oct 05, 2011 7:36 am

Re: Big merge day

Postby ickby » Mon Sep 23, 2013 8:00 pm

hm thats a strange error. You do see the assembly toolbar buttons, right? Is the "add a new part" working or does it give the same error? If so, you should have a look into your build directory if the assembly was compiled correctly. You should have "your_build_path/Mod/Assembly/AssemblyLib.pyc" and a AssemblyGui.so and Assembly.so.

And yes please report all reproducible crash, that would be very helpful. Missing features is not necessary, we are aware that the workbench is missing essential stuff :)
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Big merge day

Postby project4 » Mon Sep 23, 2013 8:15 pm

Ok, will try to reproduce everything I see strange.

New info on my first problem:
It looks like an installation problem since running as ./bin/FreeCAD works as expected.
Previously I run "sudo make install" over the official 0.13 version that caused the problem.
I do see the new assembly toolbar though and about menu shows the same version as if I run it from ./bin/

And here's another small thing:
When adding several existing components to the assembly, the numbering is not consistent...
First component is added as "STP_Part_1", while second as "STP_Part_1001", third "STP_Part_1002"...

Be prepared for the bugs reports flood in the comming days :)
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Big merge day

Postby project4 » Tue Sep 24, 2013 6:13 am

Hi,

I have the following printouts in the console until the application crashes completely.
I saw a thread that discussed about the coin error and there was suppose to be a fix.
Isn't it in the stream already?

There is not much info on the crash, is there a better way to collect needed information?

Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x315ec60 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x315ec60 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x353cf90 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x315ec60 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x353cf90 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x35d9650 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x315ec60 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x353cf90 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x35d9650 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x3458b60 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x315ec60 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x353cf90 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x35d9650 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x3458b60 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x2e6c470 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x3a313a0 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x3a40490 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x36fff10 (Separator)
Gui::DocumentItem::slotChangedObject(): Group references unknown object.
Gui::DocumentItem::slotChangedObject(): Group references unknown object.
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x3a40490 (Separator)
Coin error in SoGroup::removeChild(): tried to remove non-existent child 0x3a40490 (Separator)
*** Abort *** an exception was raised, but no catch was found.
project4
Posts: 153
Joined: Fri Jul 12, 2013 12:53 pm

Re: Big merge day

Postby project4 » Tue Sep 24, 2013 6:33 am

I think I need some guidance to fully understand how it supposed to work.

I've created a rectangular shape with some holes to play around.
Exported it to STP.
Changed to assembly workbench.
Added 2 of those parts to the assembly. Moved a bit (transformed) the second part so i can see both.
Now I want to attach those 2 with one of the sides of the rectangle.

Lets say that those 2 sides are pointing to me since both of the parts are added in the same direction.
I select both faces I was to attach (using CTRL when selecting?) and now what?
I assume I have to use the coincident tool, what type of it? Opposing or equal?
Both doesn't do what I want to.

I've tried to use the coincident tool on edges of the face I want to attach and looks like it's doing something in the desired direction, but it's more logical for me to attach the whole face and not line-by-line.

I've never used any CAD program before, so I might be missing something...

Also, the concept in the part designer is that you never have to use a keyboard for your work, you can select multiple objects with just a click.
That concept doesn't work in the assembly... You have to use the CTRL to select multiple objects.

And another question: is there a shortcut for the translate function?
It might be useful to have an easy way to move objects around to see what is behind them...

And I think I saw some pictures of SolidWorks that have an "explode" feature, something that breaks apart all the parts and draws them in a distance from each other, so you can see how it's all assembles.
Exiting that feature assembles all the parts back to their location based on the constraints. Just another item for the TODO list :)
ickby
Posts: 2922
Joined: Wed Oct 05, 2011 7:36 am

Re: Big merge day

Postby ickby » Tue Sep 24, 2013 6:53 am

Good morning,

If you have a crash the console prints are not very informative. Best is to find a way to reproduce it and post it here. Or at least a backtrace, but that may not help me much in finding the bug without reproducing it myself.

The coin error fix is not in the code yet, I need to add it to my branch first and then it will take time until jriegel merges it to dev-assembly. So no fast fixes here.

Have you seen kawahoo's video? it shows pretty good how it is supposed to work. Coincident constraint with faces make them lay on each other. If you choose equal they will lay on each other so that their normals pointing in the same direction. Oppsosite means the normals point in opposite directions (on a 3d solid the normal points towards the outside). If you choose parallel, the faces will be made coincident in the way of least moving: equal or oppisite directions dependend on what is the nearest from the starting position).

If it still gives unexpected results please elaborate a bit more on the transformation. How do you do that? It may be possible that this operation meeses up the transformations. That must be fixed then.

Also could you please start a new topic? this one gets rather of topic. Thanks for reporting!