OpenSCAD files where minkowski has been used to create a sort of fillet.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenSCAD files where minkowski has been used to create a sort of fillet.

KeithSloan52
I am the developer of the SCAD & CSG importer in the FreeCAD OpenSCAD
workbench.

At present the importer converts any  minkowski request to a mesh, I would
like to see how feasible it is to convert situations where the minkowski
request is being used to create a fillet, into a genuine Part Fillet in
FreeCAD. As a result I am looking for sample scad files which use a
minkowski request in this fashion. Obviously initially simpler cases would
be preferred.

At present I am able to deal with the simple cases as used in the files
referred to in  https://forum.freecadweb.org/viewtopic.php?f=3&t=43170
<https://forum.freecadweb.org/viewtopic.php?f=3&t=43170>  



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD files where minkowski has been used to create a sort of fillet.

nophead
The examples you give seem to be 2D and 3D rounding, not fillets. I avoid 3D fillets in the Z direction as much as possible because they are very slow and I don't think they add much, if any, strength to FDM parts because of the layering. On the other hand fillets in XY add strength and also avoid ringing when printed and can be done much faster in 2D.

To make 3D fillets I offset inwards using offset_3D() with a negative offset which uses minkowski. Code and examples here: https://github.com/nophead/NopSCADlib#offset

The shape is very simple because anything else is very slow but it will fillet any concave corners on a 3D shape, or round convex corners with a positive offset.

I also add simple fillets with this module, that doesn't use minkowski. https://github.com/nophead/NopSCADlib#Fillet. Would that also be a candidate for conversion?
 

On Sun, 9 Feb 2020 at 09:10, KeithSloan52 <[hidden email]> wrote:
I am the developer of the SCAD & CSG importer in the FreeCAD OpenSCAD
workbench.

At present the importer converts any  minkowski request to a mesh, I would
like to see how feasible it is to convert situations where the minkowski
request is being used to create a fillet, into a genuine Part Fillet in
FreeCAD. As a result I am looking for sample scad files which use a
minkowski request in this fashion. Obviously initially simpler cases would
be preferred.

At present I am able to deal with the simple cases as used in the files
referred to in  https://forum.freecadweb.org/viewtopic.php?f=3&t=43170
<https://forum.freecadweb.org/viewtopic.php?f=3&t=43170>   



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD files where minkowski has been used to create a sort of fillet.

cacb
In reply to this post by KeithSloan52
On 09.02.2020 10:09, KeithSloan52 wrote:

> I am the developer of the SCAD & CSG importer in the FreeCAD OpenSCAD
> workbench.
>
> At present the importer converts any  minkowski request to a mesh, I would
> like to see how feasible it is to convert situations where the minkowski
> request is being used to create a fillet, into a genuine Part Fillet in
> FreeCAD. As a result I am looking for sample scad files which use a
> minkowski request in this fashion. Obviously initially simpler cases would
> be preferred.
>
> At present I am able to deal with the simple cases as used in the files
> referred to in  https://forum.freecadweb.org/viewtopic.php?f=3&t=43170
> <https://forum.freecadweb.org/viewtopic.php?f=3&t=43170>

Hi Keith,

Interesting. FreeCAD is based on OpenCascade, right? At one time ~25
years ago I worked for a period with what was then called CAS.CADE (by
Matra Datavision), it was far from free then.

I guess OpenCascade today is like CAS.CADE was back then, a large BREP
CAD library providing objects for geometry and topology like vertices,
edges, faces and solids plus operations to manipulate them. Such a BREP
model is rather different from mesh based constructive solid geometry
like in OpenSCAD and similar tools, where even simple primitives like
sphere, cylinder and cube are represented as meshes only. When
everything is is a mesh, all operations are mesh based, including the
input and output from minkowski sums.

In FreeCAD/OpenCascade you obviously have similar primitives for sphere,
cylinder and cube, but they are not represented as meshes there.
Interpreting OpenSCAD primitives in OpenCascade is probably trivial and
since OpenCascade also offer standard boolean operations, you can
interpret the OpenSCAD models as long as you have only basic primitives
and standard boolean operations like union, difference and interesection.

The problem occurs when the boolean operation is "non-standard" like in
minkowski sum. I have played around with implementing minkowski sum
myself..... I could be wrong, but I don't see how a minkowski sum could
be easily implemented based on a OpenCascade model, if at all. At least
that is a tough challenge. Also note that the input parameters to
minkowski don't have to be simple primitives, they can themselves be the
result of a standard union or another minkowski.

It would be very cool if you could make it work in FreeCAD!

For an independent example OpenSCAD .csg file using Minkowski to
demonstrate fillets, see
https://gist.github.com/arnholm/e5df0a3edbe9d4aa65400a9308637861

The example was originally created using AngelCAD, but AngelCAD can
generate OpenSCAD .csg files so included there is also the generated
OpenSCAD file minkowski3d_3_3.csg plus plots showing the result in
AngelCAD and OpenSCAD (they agree).

Kind Regards
Carsten Arnholm


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD files where minkowski has been used to create a sort of fillet.

KeithSloan52
The importer in the FreeCAD importer imports a CSG file ( or if passed a scad
file it calls OpenSCAD to create a CSG file under the covers).

CSG objects are converted to FreeCAD BREP objects, two exceptions being hull
and minkowski operations, these currently are converted to FreeCAD Mesh.

One of the OpenSCAD workbench parameters is Preferences is Maximum number of
faces for polygon (fn). i.e.
If a cylinder or circle has $fn > than this value it will create a smooth
circle or cylinder. Less than this preference
and it will create a polygon. People often don't know/find out about this.
Not helped by some bad info out on the web
about need to edit csg file to change $Sn values.

Also unfortunately somebody changed the default value for this parameter to
zero. But it is easy enough to change by
going to the preferences for the workbench.

The importer was first incorporated into FreeCAD 0.13 so seven years ago.

I think it might be possible to implement the equivalent of Hull feature for
BREP objects, but not seen any attempt.

I watched Marius Kintel's FOSDEM 2020 talk on OpenSCAD where he discussed
the challenge of Fillets with OpenSCAD
So decided to look to see if for various minkowski operations I could avoid
converting to mesh. i.e if the operation is just on two objects and the two
objects meet certain criteria I use info of the second object to create a
fillet on the first. If things don't meet criteria just do a mesh operation
as normal.

As I understand it the problem would not be 3d printed objects, but if
people wanted to cnc/mill etc so take OpenSCAD file and if it creates
fillets okay one should be good to go

There was also this interesting paper that raised the issue too  http://
https://journals.plos.org/plosone/artic ... ne.0225795 <http://
https://journals.plos.org/plosone/artic ... ne.0225795>  





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org