Square to round transition

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Square to round transition

Post by johnwang »

Could you give an output example of this:

Code: Select all

S=12
D=200
ORL=0
OFB=0
ATU=0
L=300
W=200
H=500
Or a value of yours.
Last edited by johnwang on Wed Jul 20, 2022 12:45 am, edited 5 times in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Square to round transition

Post by jfc4120 »

@edwilliams16 Can you describe a brief step by step on your drawing? I know for mesh you need a small opening to work.
I don't understand how sketcher is used, isn't that just 2d only?

If you could could you attach several drawings with the various steps?

I have used mesh to unroll a pipe mitered, and had to make cylinder degree 359 instead of 360.

Edit:

Also where and how is the cut. And also the usage of array?
Attachments
steps.png
steps.png (63.53 KiB) Viewed 1016 times
Last edited by jfc4120 on Wed Jul 20, 2022 12:52 am, edited 1 time in total.
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Square to round transition

Post by jfc4120 »

@johnwang You must have mm, I work in inch (in).
Attachments
Screenshot 2022-07-19 194732.png
Screenshot 2022-07-19 194732.png (19.71 KiB) Viewed 996 times
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Square to round transition

Post by edwilliams16 »

I'll explain a more general, but in other ways simplified workflow. It will be an outline. Let me know if you get stuck on prticular steps.
Screen Shot 2022-07-19 at 2.49.13 PM.png
Screen Shot 2022-07-19 at 2.49.13 PM.png (20.52 KiB) Viewed 979 times
  • Create Sketch of the base rectangle on the XY-plane with the edge centerpoints as extravertices.
Screen Shot 2022-07-19 at 2.54.44 PM.png
Screen Shot 2022-07-19 at 2.54.44 PM.png (21.02 KiB) Viewed 979 times
  • Create Sketch001 of the top circle with points at the four quadrants.
Screen Shot 2022-07-19 at 2.56.59 PM.png
Screen Shot 2022-07-19 at 2.56.59 PM.png (21.47 KiB) Viewed 979 times
  • Adjust the Placement of Sketch001 to place it above the Sketch, tilted and offset as desired.
  • Now we create four lofts from the corners of Sketch to the corresponding arcs of Sketch001 (no symmetry assumed)
  • We create Part Design SubshapeBinders for the respective vertices and edges and use Part|Loft with ruled surface checked between them
  • We create four more lofts between the vertices of Sketch001 and the corresponding edges of Sketch in the same way.
  • Part Boulean Union on the eight lofts.
  • Cut a thin (0.2 mm) slot along the desired seam by making a thin Part cube and doing a Boolean Cut.
  • Mesh Design|Mesh from Shape on Cut. Analyze and repair as required.
  • Mesh Design|Unwrap Mesh
Attachments
recttotiltedcircle.FCStd
(169.48 KiB) Downloaded 22 times
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Square to round transition

Post by jfc4120 »

@edwilliams16 I will go over this. How do you place the circle where needed, since it's a sketch.

The pipe I did I drew everything in draft mode.
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Square to round transition

Post by johnwang »

Why I got 170 instead of 150 for the bottom line of the FIRST BACK TRIANGLE
The code is:

Code: Select all

            #>LINE
            #{
            #<POINTXYZ 20,0,0
            #<POINTPOLAR [XP1, (LANG + ANGFB), 0]
            #}
My code is:

Code: Select all

            tx2=XP1*math.cos(LANG + ANGFB)
            ty2=XP1*math.sin(LANG + ANGFB)
            tz2=0
You draw from left to right, and I draw from right to left.
Maybe there is a sign different for the sin & cos.
150.jpg
150.jpg (25.48 KiB) Viewed 940 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Square to round transition

Post by jfc4120 »

@johnwang yes I normally lay out a fitting as though I'm inside of it and I rotate myself counterclockwise. Just the way I was taught, that way on the metal you don't have a bunch of markings on the outside only on the inside.

But just reversing and doing outside should work.
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Square to round transition

Post by edwilliams16 »

jfc4120 wrote: Wed Jul 20, 2022 1:24 am @edwilliams16 I will go over this. How do you place the circle where needed, since it's a sketch.

The pipe I did I drew everything in draft mode.
Screen Shot 2022-07-19 at 4.01.52 PM.png
Screen Shot 2022-07-19 at 4.01.52 PM.png (52.37 KiB) Viewed 922 times
You create Sketch001 (like Sketch) on the X-Y Plane, You then adjust its Placement.
Here the Sketch circle is tilted by 20 degrees about its x-Axis, then displaced by (5, 2, 35) ie 35 mm above the x-y Plane and displaced by (5, 2) mm in x-y plane.
https://wiki.freecadweb.org/Placement is a fundamental concept in FreeCAD. It moves and orients objects.
jfc4120
Posts: 448
Joined: Sat Jul 02, 2022 11:16 pm

Re: Square to round transition

Post by jfc4120 »

@edwilliams16 you have:
Adjust the Placement of Sketch001 to place it above the Sketch, tilted and offset as desired.

Now we create four lofts from the corners of Sketch to the corresponding arcs of Sketch001 (no symmetry assumed)

We create Part Design SubshapeBinders for the respective vertices and edges and use Part|Loft with ruled surface checked between them

We create four more lofts between the vertices of Sketch001 and the corresponding edges of Sketch in the same way.

Part Boulean Union on the eight lofts.

Cut a thin (0.2 mm) slot along the desired seam by making a thin Part cube and doing a Boolean Cut.

Mesh Design|Mesh from Shape on Cut. Analyze and repair as required.

Mesh Design|Unwrap Mesh
The "and use Part|Loft with ruled surface checked between them", you do lofted and ruled? I will try, but don't see how. I thought it was one or the other.

EDIT:

I am trying a fourth first. I cannot get placement to work on a sketch, I tried placement 7 on z axis, it did nothing:

I don't know how to move a sketch if placement won't move it. I am re-reading about placement however.
Attachments
I even tried data tab, put it's blocked, not allowing typing.
I even tried data tab, put it's blocked, not allowing typing.
Screenshot 2022-07-19 220841.png (7.86 KiB) Viewed 880 times
s1.png
s1.png (28.92 KiB) Viewed 889 times
s2.png
s2.png (13.44 KiB) Viewed 889 times
s3.png
s3.png (44.12 KiB) Viewed 889 times
Last edited by jfc4120 on Wed Jul 20, 2022 3:12 am, edited 1 time in total.
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Square to round transition

Post by edwilliams16 »

Edit the Placement|Position I showed in my previous screenshot.

Here's the Part|Loft dialog:
Screen Shot 2022-07-19 at 5.08.07 PM.png
Screen Shot 2022-07-19 at 5.08.07 PM.png (55.19 KiB) Viewed 885 times
Ruled Surface is checked. That guarantees a developable surface - though it may well work without.
Post Reply