"collision detection", overlapping
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
"collision detection", overlapping
Hi,
just for curiosity: Once someone showed off about "collision detection" in his CAD. Since then I wondered is there is a way in freecad, to say, finding out if two shapes are overlapping?
Maybe there is a (FreeCAD or occ) function near it?
And one might ask, how important would be such "overlapping detection" for an cad-program. Opinions?
Tia
just for curiosity: Once someone showed off about "collision detection" in his CAD. Since then I wondered is there is a way in freecad, to say, finding out if two shapes are overlapping?
Maybe there is a (FreeCAD or occ) function near it?
And one might ask, how important would be such "overlapping detection" for an cad-program. Opinions?
Tia
Re: "collision detection", overlapping
It should be easy, at least in python: Make an intersection and get the volume, this macro could help: http://freecadweb.org/wiki/index.php?title=Macro_FCInfo
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: "collision detection", overlapping
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: "collision detection", overlapping
Hi!
I've written this brief script that looks for common volumes between shapes and colors them in red:
Select the shapes and copy-paste it, thats all.
Resut:
I've written this brief script that looks for common volumes between shapes and colors them in red:
Select the shapes and copy-paste it, thats all.
Code: Select all
# JMG 2015
object_list = []
for obj in FreeCAD.Gui.Selection.getSelectionEx():
obj = obj.Object
object_list.append( obj )
for n in range( len(object_list) ):
object_A = object_list[n]
for i in range( len(object_list) ):
if i <= n:
pass
else:
object_B = object_list[i]
common = object_A.Shape.common( object_B.Shape )
if common.Volume > 0.0:
FreeCAD.Console.PrintMessage( '-Intersection- ' + object_A.Name + ' with ' + object_B.Name + '\n')
FreeCAD.Console.PrintMessage( 'Common volume' + str( common.Volume ) + '\n' + '\n' )
intersection_object = FreeCAD.ActiveDocument.addObject( 'Part::Feature' )
intersection_object.Shape = common
intersection_object.ViewObject.ShapeColor = ( 1.0,0.0,0.0,1.0 )
object_A.ViewObject.Transparency = 80
object_B.ViewObject.Transparency = 80
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Re: "collision detection", overlapping
hi JMG
if you put your macros (this macro and Text sticker) in "Macros_recipes" they will be more easily accessible
you can request a write permission for the wiki or ask someone to do
mario
if you put your macros (this macro and Text sticker) in "Macros_recipes" they will be more easily accessible
you can request a write permission for the wiki or ask someone to do
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
Re: "collision detection", overlapping
Code: Select all
if you put your macros (this macro and Text sticker) in "Macros_recipes" they will be more easily accessible
you can request a write permission for the wiki or ask someone to do
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Re: "collision detection", overlapping
hi
it's easier than Python, if you prefer to have visits to your site,
create a page with explanations and one link to download the code on your site
here for permission here Macros_recipes for the table of contents full macros
and ... here for the help ...
mario
it's easier than Python, if you prefer to have visits to your site,
create a page with explanations and one link to download the code on your site
here for permission here Macros_recipes for the table of contents full macros
and ... here for the help ...
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
-
- Posts: 436
- Joined: Wed Sep 15, 2010 9:38 am
Re: "collision detection", overlapping
Added (@JMG, I hope with your permission) as http://www.freecadweb.org/wiki/index.ph ... ightCommon.
Similarly, also added http://www.freecadweb.org/wiki/index.ph ... Difference.
Cheers,
Gaël
Similarly, also added http://www.freecadweb.org/wiki/index.ph ... Difference.
Cheers,
Gaël
Re: "collision detection", overlapping
Sure, I had this in my TODO list, thanks for doing itAdded (@JMG, I hope with your permission) as
FreeCAD scripts, animations, experiments and more: http://linuxforanengineer.blogspot.com.es/
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Open source CNC hot wire cutter project (NiCr): https://github.com/JMG1/NiCr
Exploded Assembly Workbench: https://github.com/JMG1/ExplodedAssembly
Re: "collision detection", overlapping
Thanks to all.
aha.
-disttoshape
-common (boolean intersection)
-and another interface in development
well, is it in use, maybe at simulating assemblies, when one piece hits the other, I ask myself? Are there examples for it?
aha.
-disttoshape
-common (boolean intersection)
-and another interface in development
well, is it in use, maybe at simulating assemblies, when one piece hits the other, I ask myself? Are there examples for it?