Hello, Thank you for reading my post. I am having issues lofting with two wire objects generated from a .dat file. The issue is that I am ending up with more faces and lines than expected on the lofted feature. I looked at different tutorials and I cannot find another instance of this happening. Any help is appreciated. Thank you.
Attached is the FreeCAD model file with the issue and an image of what is on my machine. I cannot upload the . dat file but it is 600 rows of 2 columns of the format:
1.000000 0.001260
0.995000 0.001959
0.990000 0.002654
...
0.995000 -0.001959
1.000000 -0.001260
my current version information:
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
Loft creating more lines and faces than expected
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 2
- Joined: Tue Jan 18, 2022 10:54 pm
Loft creating more lines and faces than expected
- Attachments
-
- loft.PNG (7.76 KiB) Viewed 774 times
-
- airfoil.FCStd
- (166.24 KiB) Downloaded 11 times
-
- close up of the loft I am generating
- freecad_loft_issue.PNG (91.7 KiB) Viewed 774 times
Re: Loft creating more lines and faces than expected
I am guessing that you made the wire from the 600 points. That will create a polygon with 600 sides. The lines you are seeing are the breaks between each of those 600 segments.
If you simply want a nice view you can select View >> Draw Style >> Shaded in the top menu.
If you really want the actual segments to smoothly blend then you will need to do a bit more work. One method is to redraw with splines in the Sketcher WB. Significantly more effort.
Gene
If you simply want a nice view you can select View >> Draw Style >> Shaded in the top menu.
If you really want the actual segments to smoothly blend then you will need to do a bit more work. One method is to redraw with splines in the Sketcher WB. Significantly more effort.
Gene
Re: Loft creating more lines and faces than expected
does not have to be much work to get it to a spline.
a polyline can be made into a spline with a click in draft... Draft_WireToBSpline
or Macro_AeroFoil
or a handful lines of python does the job.
a polyline can be made into a spline with a click in draft... Draft_WireToBSpline
or Macro_AeroFoil
or a handful lines of python does the job.
Code: Select all
import Draft
from pathlib import Path
text = """
1.000000 0.001260
0.995000 0.001959
0.990000 0.002654
0.995000 -0.001959
1.000000 -0.001260
"""
floatify = lambda row: [float(c) for c in row.split()] + [0]
pts = [App.Vector(*floatify(row)) for row in text.splitlines()]
spl = Draft.makeBSpline(pts) # makeBSpline(pts, closed=True)
# if you do not want to paste the 600 lines here...
#file = Path(r'c:\to where ever the file is')
#text = file.read_text()
# small comment
# not very meaningful to have 600 points in a spline
# if you do pts[::6] it will take every 6th point,
# you probably have to adjust your input a bit to get the ones
# you need to make the ending nice, or just do pts[::6] + pts[-1:]
# or something along those lines
# suppose one needs to watch out both at leading/trailing edge with the points
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Loft creating more lines and faces than expected
Thanks for that little tip. I did not know about this [::6] to get only every 6th point.heda wrote: ↑Wed Jan 19, 2022 5:02 pmCode: Select all
# small comment # not very meaningful to have 600 points in a spline # if you do pts[::6] it will take every 6th point, # you probably have to adjust your input a bit to get the ones # you need to make the ending nice, or just do pts[::6] + pts[-1:] # or something along those lines # suppose one needs to watch out both at leading/trailing edge with the points
I also agree that fewer points can produce a better surface. I have seen this in ThreadProfile. The problem with such reduction is you can get a less accurate representation if some significant points are skipped. If you know where the important points are then you can use some form of variable density. For example if points 300-400 are more significant:
Code: Select all
pts = pts[:299:6] + pts[300:400:2] + pts[401::6]
Re: Loft creating more lines and faces than expected
I might have missed it in the discussion and is an FYI FWIW comment.
If the profile was imported via the File>Import Common airfoil data, then the wire that is created ends up being a spline with what ever number of vertexes were defined in the file...and thus when extruded, there is an edge for each.
I realized this while looking at the recent updates in importAirfoilDAT.py
If the profile was imported via the File>Import Common airfoil data, then the wire that is created ends up being a spline with what ever number of vertexes were defined in the file...and thus when extruded, there is an edge for each.
I realized this while looking at the recent updates in importAirfoilDAT.py
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
-
- Posts: 2
- Joined: Tue Jan 18, 2022 10:54 pm
Re: Loft creating more lines and faces than expected
thanks all for all of the help! THE Advice and the python code worked!