How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
DHaC
Posts: 4
Joined: Thu Aug 19, 2021 7:20 pm

How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Post by DHaC »

Sorry for not having the clearest title but what I'm trying to do is cut a circular hole in the side of a cylinder, that was created by lofting 2 circular wires, such that the hole matches the wire that is the top of another cylinder. The "internal cylinder" is highlighted in green in the image below.
fullFig.PNG
fullFig.PNG (154.09 KiB) Viewed 1420 times
This would be simple if I were allowed to subtract the internal cylinder from the solid but I'm restricted to operating on a per-surface basis for this application; I am restricted to using only the points that lie on the surface.

So far, my procedure when working with the large lofted cylinder's outer surface is to
- make an extrusion using the internal cylinder's end and cut it from the surface using a "Part::Cut" where the Base is the lofted surface (the result of a Part.makeLoft using the top and bottom wires where Solid=False, Ruled=True, Closed=False) and the Tool is the Part::Extrusion
- Identify the intersection of the extrusion and the lofted surface using a Part::Section where the Base is the lofted surface and the Tool is the extrusion
- And finally use the intersection as the new end wire for the lofting of the internal cylinder (this is saved and used later when working on the internal cylinder's surface)

A very zoomed view of where the lofted surface and internal cylinder meet is shown below
holeZoom.PNG
holeZoom.PNG (15.21 KiB) Viewed 1420 times
My guess is that this edge discrepancy is because the lofted surface removes the edges that would constitute the intersection during the cut and thus the large cylinder and internal cylinder don't meet at precisely the same edge.

Is there a better way to got about this process?
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Post by chrisb »

Can you upload the file?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
DHaC
Posts: 4
Joined: Thu Aug 19, 2021 7:20 pm

Re: How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Post by DHaC »

Sorry, I forgot. Here is part file shown in the post
problemPart.step
(531.79 KiB) Downloaded 28 times
The hole in question is the one in the negative X space. The hole in the positive X space has a separate issue I'm trying to resolve with the lofting (it's edges follow the same procedure though).
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Post by onekk »

Probably the discrepancy is not a "real" discrepancy, maybe it is simple a "rendering artifact".

Take in account, that FreeCAD has two "engines":
  1. A "modeling engine" OCCT.
  2. A "visualization engine" Coin3D.
So when you see things, on screen you are seeing a "Coin 3D" representation of an OCCT model.

This could lead to some discrepancy see:

https://wiki.freecadweb.org/Scenegraph

You could tune something in the View Tab, usually you will find them set as:

Code: Select all

AngularDeflection = '28.5500 deg'
Deviation = 0.50

But with this simple example

Code: Select all

import Part
from FreeCAD import Vector

circ = Part.makeCircle(100, Vector(0,0,0))

circ1 = circ.copy()
Part.show(circ1, "circle_rough")

FreeCADGui.getDocument('test').getObject('circle_rough').AngularDeflection = '28.5 deg'
FreeCADGui.getDocument('test').getObject('circle_rough').Deviation = 0.50

circ2 = circ.copy()
Part.show(circ1, "circle_fine")

FreeCADGui.getDocument('test').getObject('circle_fine').AngularDeflection = '5.0000 deg'
FreeCADGui.getDocument('test').getObject('circle_fine').Deviation = 0.05

You could see the difference, in the image below.
3dview_diff.png
3dview_diff.png (3.64 KiB) Viewed 1305 times
Note that the object is the same, as both objects are a copy of the same circle, that is stored internally as a "infinite curve", but when visualized it became a "polygonal approximation", as it have to be translated in pixels by Coin3D.

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/
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Post by chrisb »

DHaC wrote: Fri Dec 03, 2021 2:39 pm Sorry, I forgot. Here is part file shown in the post problemPart.step
Can you provide the FreeCAD file?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
DHaC
Posts: 4
Joined: Thu Aug 19, 2021 7:20 pm

Re: How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Post by DHaC »

chrisb wrote: Fri Dec 03, 2021 4:43 pm
DHaC wrote: Fri Dec 03, 2021 2:39 pm Sorry, I forgot. Here is part file shown in the post problemPart.step
Can you provide the FreeCAD file?
I'm doing all this in python so there isn't one (the step file is the only one I generate/save in this process). I can open the step and save it as a FreeCAD file if that helps (I suspect it does not though).
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: How best to cut a hole through a lofted surface such that cut hole matches a perpednicular

Post by onekk »

Post the script, so maybe others could investigate and make some tests.

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/
Post Reply