Simulated Weld
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Simulated Weld
I had hoped for a moment that a distorted clone of a sphere would save space but in vain: A comparison of file sizes yields:
single sphere: 2830
ellipsoid: 3252
sphere+clone: 4550
And while the BOPCheck succeeds on a sphere it fails again on the distorted clone - which in fact is an ellipsoid.
single sphere: 2830
ellipsoid: 3252
sphere+clone: 4550
And while the BOPCheck succeeds on a sphere it fails again on the distorted clone - which in fact is an ellipsoid.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Simulated Weld
Code: Select all
import numpy as np
import random
ptsk=[]
d0=9
d1=6
xl=10
for i in range(20):
if i<>0:
d=d0*(0.8+random.random()*0.4)
pts=[FreeCAD.Vector(i*xl,d*np.sin(np.pi*a/6),d*np.cos(np.pi*a/6)) for a in range(12)]
ptsk += [pts]
d=d1*(0.9+random.random()*0.2)
pts=[FreeCAD.Vector(i*xl+xl*(0.5+random.random()*0.1),d*np.sin(np.pi*a/6)+random.random()-0.5,d*np.cos(np.pi*a/6)+random.random()-0.5) for a in range(12)]
ptsk += [pts]
d=d1*(0.9+random.random()*0.2)
pts=[FreeCAD.Vector(i*xl+xl*(0.5+random.random()*0.1),d*np.sin(np.pi*a/6)+random.random()-0.5,d*np.cos(np.pi*a/6)+random.random()-0.5) for a in range(12)]
ptsk += [pts]
uc=3*20-2
vc=11
def createNurbs(ptsarr,uc=0,vc=0):
'''create the nurbs representation'''
nu = FreeCAD.ActiveDocument.addObject("Part::Spline","_N")
bs=Part.BSplineSurface()
kv=[1.0/(uc-3+1)*i for i in range(uc-2+1)]
mv=[4]+[1]*(uc-4+1)+[4]
ku=[1.0/(vc-3+1)*i for i in range(vc-2+1)]
mu=[4]+[1]*(vc-4+1)+[4]
bs.buildFromPolesMultsKnots(ptsarr, mv, mu, kv, ku, False, False ,3,3)
nu.Shape=bs.toShape()
return nu
createNurbs(ptsk,uc,vc)
Re: Simulated Weld
Just FYI, in commercial CAD software with weld features (at least mid-range ones), a fillet weld is just displayed as following:
The fillet feature has a bitmap image mapped to its faces to simulate texture, that you can choose to display on screen or not.
One useful thing is that when creating a weld callout in a drawing view, it extracts welding information from the fillet feature.
I think a macro that would sweep a triangle along a selected edge would be simpler and keep a lower filesize. The trick would be for the triangle sides to always be collinear to the faces attached to the edge. And of course it would not be as pretty as those spheres!
The fillet feature has a bitmap image mapped to its faces to simulate texture, that you can choose to display on screen or not.
One useful thing is that when creating a weld callout in a drawing view, it extracts welding information from the fillet feature.
I think a macro that would sweep a triangle along a selected edge would be simpler and keep a lower filesize. The trick would be for the triangle sides to always be collinear to the faces attached to the edge. And of course it would not be as pretty as those spheres!
Re: Simulated Weld
I remember that is the way it is shown in books about welding. Especially the different colour is very helpful.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Simulated Weld
With a few var.defs. BOOM!
Thanks MElly! I did not know you were also a master welder!
Re: Simulated Weld
Any closer and we would see welding sparks too.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Simulated Weld
I went straight to watching the video. Thanks for using the welding glass filter by default.
Re: Simulated Weld
Next time you need to warn us!! I didn't have my Welding mask on!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Simulated Weld
How would that work for "external" edge welds?NormandC wrote: ↑Sun Mar 04, 2018 9:50 pm I think a macro that would sweep a triangle along a selected edge would be simpler and keep a lower filesize. The trick would be for the triangle sides to always be collinear to the faces attached to the edge. And of course it would not be as pretty as those spheres!
Feeling like spheres have the advantage of working in all flat, interior and exterior cases, aren't they?
But thinking about penetration too sweeping a circle, partly dipped in welded parts, could be another approximation option... WDYT?