Creating a cross section view in Drawing
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!
Creating a cross section view in Drawing
Hi,
I managed to create a drawing from a 3D part I designed. The part is cylindrical and thus providing a cross sectional view is very helpful for dimensioning etc.
How do I get FreeCAD to create a cross sectional view, or how do I manually add it to the drawing?
I managed to create a drawing from a 3D part I designed. The part is cylindrical and thus providing a cross sectional view is very helpful for dimensioning etc.
How do I get FreeCAD to create a cross sectional view, or how do I manually add it to the drawing?
Re: Creating a cross section view in Drawing
Currently there is no dedicated tool for that in the Drawing WB, but have a look at the Arch SectionPlane tool, it should be able to help you.
Re: Creating a cross section view in Drawing
Yorik, it appears that an Arch Section that is projected as a view on a drawing page does not have an option to display hatching or solid filling of the shape, am I correct?
Re: Creating a cross section view in Drawing
Indeed. What it does under the hood, is just create a big invisible solid behind the section plane, subtract it from the object(s) cut by the section plane, and project the result.
You have two projection options, though: The normal Drawing module algorithm, which is used by other Drawing tools, and the Arch renderer I did some time ago, which unlike the former one does project faces as closed paths, so they can receive filling. But this renderer is still very buggy (and awfully slow).
But, even when using the Drawing algorithm, the edge loops at the intersection of the object(s) and the section plane are gathered (so they can be drawn with thicker line). So, turning these edge loops into closed paths (and therefore give them color or pattern fills) would not be hard to do...
You have two projection options, though: The normal Drawing module algorithm, which is used by other Drawing tools, and the Arch renderer I did some time ago, which unlike the former one does project faces as closed paths, so they can receive filling. But this renderer is still very buggy (and awfully slow).
But, even when using the Drawing algorithm, the edge loops at the intersection of the object(s) and the section plane are gathered (so they can be drawn with thicker line). So, turning these edge loops into closed paths (and therefore give them color or pattern fills) would not be hard to do...
Re: Creating a cross section view in Drawing
Not sure what you mean. I don't see any projection tool in the Arch workbench.yorik wrote:You have two projection options, though: The normal Drawing module algorithm, which is used by other Drawing tools, and the Arch renderer I did some time ago, which unlike the former one does project faces as closed paths, so they can receive filling. But this renderer is still very buggy (and awfully slow).
BTW contrary to what the Arch Section wiki page says, it does not automatically create a view on a drawing page.
Before you first replied, I had toyed with a workaround.
First, I created a cylinder with a hole in it, then I cut it in half longitudinally ("Pocket" in my FreeCAD file). Then I selected the two planar faces resulting from the cut and I created a Draft Facebinder object that I rotated to the XY plane.
Since the two faces are unconnected, I selected the Pocket and created a Draft Shape2DView, changed its projection to (0,-1,0) and rotated it to the XY plane. With the Facebinder and Shape2DView placed over each other, this creates an acceptable section view representation. Then in the Model tree I created a group that I renamed "Section", and drag & dropped both the Facebinder and the Shape2DView object. The idea was to create a single projected view with both elements, which is only possible with a view created from a group.
I created the view from the "Section" group using the Draft Drawing tool. In the ViewSection properties, I changed the "Fill Style" to "shape color". I tried using another fill style, but I could'nt control their scale. When viewing the drawing page in the browser view, the hatching for "simple" is incredibly small, you have to zoom like crazy to see they are slanted lines.
I created a top view of the "Pad" object, and in the 3D view I drew a section symbol using Draft tools (lines and text), made a new "Section2" group and projected it over my orthogonal view. This is the result. I added the centerlines and the diameter dimensions with the "Drawing Dimensioning workbench" external add-on from hamish (it requires the 0.15 development version). I should add that the Facebinder and Shape2DView objects are fully parametric, i.e. they are linked to the Pocket feature. If there's any change to the original "Pad", these changes will propagate to them, and to the drawing view as well.
- Attachments
-
- Cylinder_Drawing_Section.fcstd
- (42.95 KiB) Downloaded 505 times
Re: Creating a cross section view in Drawing
Hi again,
For the hatch pattern I use this python script :
It takes a file "renduSVG_h.svg" (exported with freecad), and modify all the grey fill (color #cccccc) by the hatch pattern. Maybe you will have to change the line number (36 here) by 35 of 37, depends of the file.
It's just a trick that I would like to share, not the better solution in my opinion^^, but it works.
For the hatch pattern I use this python script :
Code: Select all
# ajout du pattern
f = open("./renduSVG.svg", "r")
contents = f.readlines()
f.close()
contents.insert(36, " \
<pattern id=\"diagonalHatch\" width=\"2\" height=\"2\"\n \
patternTransform=\"rotate(-45 0 0)\" \n \
patternUnits=\"userSpaceOnUse\"> \n \
<line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"30\" style=\"stroke:black; stroke-width:0.2\" /> \n \
</pattern> \n")
# remplacement de toutes les zone filled avec du gris par le pattern
f = open("./renduSVG_h.svg", "w")
contents = "".join(contents)
f.write(contents)
f.close()
infile = open('./renduSVG_h.svg', 'r+')
outfile = open('./renduSVG_hm.svg', 'w')
replacements = {'fill:#cccccc':'fill:url(#diagonalHatch)', 'trytrytry':'nothing'}
for line in infile:
for src, target in replacements.items():
line = line.replace(src, target)
outfile.write(line)
infile.close()
outfile.close()
It's just a trick that I would like to share, not the better solution in my opinion^^, but it works.
Re: Creating a cross section view in Drawing
Very nice drawing!
I'm working on something to be able to make decent fill patterns in the Drawing view, with precise control over size and linewidth... More to come...
I'm working on something to be able to make decent fill patterns in the Drawing view, with precise control over size and linewidth... More to come...
Re: Creating a cross section view in Drawing
Ok, thank you very much Yorik, it seems to be the last thing missing to get a nice CAD drawing
Re: Creating a cross section view in Drawing
Hi,
Are there same new solutions/tools after last post included in last versions regarding "Creating a cross section view in Drawing"?
I am using:
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5958 (Git)
Build type: Release
Branch: master
Hash: b3e0e8272f0ed017caf7644808e929c87a85937e
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
brgds
Janeks
Are there same new solutions/tools after last post included in last versions regarding "Creating a cross section view in Drawing"?
I am using:
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5958 (Git)
Build type: Release
Branch: master
Hash: b3e0e8272f0ed017caf7644808e929c87a85937e
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
brgds
Janeks