Pocket operation distorts solid made from b-spline profiles

Report observations made with the new Toponaming branch.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Pocket operation distorts solid made from b-spline profiles

Post by onekk »

Jon557 wrote: Wed Nov 09, 2022 1:00 am ...
Loft is a complicated operation, and from what the images are showing, probably "number of segments" of the two wires don't match, so the operation is not doing " a smooth surface", I don0t know exactly the internal algorithm but:

https://wiki.freecadweb.org/Part_Loft#L ... plications

Is a very interesting reading.

Something similar to this problem, sorry for the code in it but some images in the second link, I think that will explain the problem.

https://forum.freecadweb.org/viewtopic.php?f=3&t=71126

https://forum.freecadweb.org/viewtopic.php?f=22&t=71181

Hope it helps.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Pocket operation distorts solid made from b-spline profiles

Post by jnxd »

Jon557 wrote: Wed Nov 09, 2022 1:00 am > I have unionised a square (touching and overlapping), no issues, looks great.
> I have unionised a cylinder (just touching), no issues, looks great.
> But when I unionise a cylinder that overlaps, all hell breaks loose.
So is the issue that the triangles are too coarse as in the OP of this thread?
Jon557 wrote: Wed Nov 09, 2022 1:00 am Is this meant to happen? Have I done something wrong to the cylinder? Ideally I don't want to have to cut all the cylinders so they don't overlap other shapes.

Here is my sketch (2 shapes also visible), I've not bothered about a lot of constraints at this stage...
pic1.png

I have noticed I can see the mesh issue when I show all the shapes and the union together (this issue translates into CURA and to my 3D printer).
pic2.png

Here is an image when I detatch the cylinder from the sketch main body
pic3.png

Finally here is an image with the cylinder simply touching the side of the sketch main body, there are lines but I think they are just the resolution lines, no issues when printed etc.
pic4.png
The highlighted shape and the rest do not show fine if the surfaces overlap. Is that your complaint?
Jon557 wrote: Wed Nov 09, 2022 1:00 am I am using version 20.1 but I was also having the issue in version 18 a few weeks back.
When sharing the version info, just use Help->About FreeCAD and copy-paste the version info. There are some version details that can be missed otherwise.
My latest (or last) project: B-spline Construction Project.
Jon557
Posts: 4
Joined: Wed Nov 09, 2022 12:26 am

Re: Pocket operation distorts solid made from b-spline profiles

Post by Jon557 »

Loft is a complicated operation, and from what the images are showing, probably "number of segments" of the two wires don't match, so the operation is not doing " a smooth surface", I don0t know exactly the internal algorithm but:
Thanks, some very good material, I think I'll go through it a couple more times to try and understand more of it. Loft is new to me. But I guess by adding the extra cylinder it wants to map it's segments onto the B-Spline segments which is then causing an unsual vertex/mesh.

I kind of get the impression more knots may help but they need to be evenly spaced.
So is the issue that the triangles are too coarse as in the OP of this thread?
It's more the mesh is very random and can be pitted to quite a large degree. I don't think it happens if I unionise a shape the full height of the B-Spline sketch, in my photos the cylinder is small so I think that it creating unsualy connections or tugging on the segments in the B-spline (?). I might be wildly out on this.

The issue I get can be seen better on the CURA splicer below, I'm expecting a smooth curve but the mesh is very pitted.
Screenshot from 2022-11-14 15-23-53.png
Screenshot from 2022-11-14 15-23-53.png (234.96 KiB) Viewed 2176 times
Here is a comparison, I want to see the image on the right.
Screenshot from 2022-11-14 15-29-09.png
Screenshot from 2022-11-14 15-29-09.png (312.81 KiB) Viewed 2176 times
Thanks.

Code: Select all

OS: Ubuntu Core 20 (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29177 +233 (Git) Snap 245
Build type: Release
Branch: tag: 0.20.1
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.3, Coin 4.0.0, Vtk 7.1.1, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Pocket operation distorts solid made from b-spline profiles

Post by adrianinsaval »

I doubt that this can be addressed on the FreeCAD side of things, seems like an occt issue.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Pocket operation distorts solid made from b-spline profiles

Post by jnxd »

adrianinsaval wrote: Mon Nov 14, 2022 6:00 pm I doubt that this can be addressed on the FreeCAD side of things, seems like an occt issue.
Is OCCT actually handling STL? This looks like something gmsh should be doing...
My latest (or last) project: B-spline Construction Project.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Pocket operation distorts solid made from b-spline profiles

Post by adrianinsaval »

Direct stl export of shapes just uses the existing tessellation, which is done by occt, the issue can be observed in FreeCAD itself without exporting as stl actually.
At least in 2D gmsh doens't have very good results for this kind of splines by default so I'm not sure if that would bring much improvement, besides that I don't think gmsh is the best choice for this job since it does meshes like this for planar rectangular faces:
Captura de pantalla 2022-11-14 172336.png
Captura de pantalla 2022-11-14 172336.png (16.94 KiB) Viewed 2122 times
when you truly only need two triangles per rectangle.

The current best workflow for stl export is to mesh the shape in the mesh workbench adjusting parameters as needed and then export that but this is cumbersome, specially if the shape is modified and you need to re mesh to re export.
Jon557
Posts: 4
Joined: Wed Nov 09, 2022 12:26 am

Re: Pocket operation distorts solid made from b-spline profiles

Post by Jon557 »

I have also noticed this issue in another file, it can look perfect but changing some B-Spline weights can damage the mesh, exactly the same as in the photos above. It seems somewhat random when I change the weights but I guess under the covers the connections are joining in better locations and thus harmonising the mesh (?)
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Pocket operation distorts solid made from b-spline profiles

Post by jnxd »

adrianinsaval wrote: Mon Nov 14, 2022 8:39 pm The current best workflow for stl export is to mesh the shape in the mesh workbench adjusting parameters as needed and then export that but this is cumbersome, specially if the shape is modified and you need to re mesh to re export.
That can still be automated, I believe. Especially with FC Nodes if that's supported. In general OCC is often not in our hands. so whatever gives more control in our hands is best, I believe.
My latest (or last) project: B-spline Construction Project.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Pocket operation distorts solid made from b-spline profiles

Post by adrianinsaval »

I certainly don't know how to automate this, there was a request somewhere to make the mesh objects in the mesh workbench editable and linked to the original geometry such that they can be simply recomputed when required instead of having to create a mesh from scratch every time.
Post Reply