How do I easily extrude an object from a side profile?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

How do I easily extrude an object from a side profile?

Post by Moult »

I am currently aware of three methods to extrude objects:

1. Use the structure tool (main benefit: it is a BIM object)
2. Use the extrude tool (main benefit: tailored towards extruding, many options)
3. Use the "trim" tool (main benefit: intuitive visual feedback on extruding)

My questions are as follows:

1. Do we need three tools? Can we consolidate? (i.e. give the extrude tool the "visual feedback" of the trim tool, and separate BIM objects into another thing entirely - something that perhaps allows you to assign it a geometry as a shape representation)
2. For the first two, it is hard to change the direction of the extrude, I have to set the direction to "custom" in an extrude, because the normal is not immediately visible, similarly for structure I have to numerically type something in to flip the extrusion direction.
3. For the first two, it is quite hard to "rapidly" extrude. I have to think about dimensions and directions and have to fill out a form just to do a simple task, I can't just draw something roughly then fix it later.
4. I think the "trim" tool works for top-down profiles, but it doesn't work for side profiles?

Maybe I am missing something?
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: How do I easily extrude an object from a side profile?

Post by yorik »

You could add the PartDesign Pad to the list...

My 2 cents:

- in freecad it's quite normal to have several tools to do the same thing, due to the crazy modules development activity, it will likely intensify
- it's always good to have one, basic, "dumb" Part tool that has not many whistles and bells but is rock-solid
- other workbenches are there to propose refined, more advanced methods, that's a good thing

Now, indeed the Draft trim tool is a weird, hybrid thing (I think we should separate the extrude functionality out of the tool), and you should be able to create and edit the draft structure extrusion graphically. But I think each of these tools has its distinct use...

And of course, 100% agree with the Arch/BIM "separation" plan. Now that 0.18 is out (so to speak, just need the packages to be ready), we can start working on this...
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: How do I easily extrude an object from a side profile?

Post by vocx »

Moult wrote: Fri Mar 15, 2019 3:37 am I am currently aware of three methods to extrude objects:

1. Use the structure tool (main benefit: it is a BIM object)
2. Use the extrude tool (main benefit: tailored towards extruding, many options)
3. Use the "trim" tool (main benefit: intuitive visual feedback on extruding)
Since you are talking about different workbenches you should prefix the workbench name to the tool. They are Arch Structure, Part Extrude, and Draft Trimex. The "trim" tool is better described as "trimex", because it trims or extends. I think it's important to mention that, otherwise it sounds odd that you say that "a trim tool extrudes".
My questions are as follows:

1. Do we need three tools? Can we consolidate? (i.e. give the extrude tool the "visual feedback" of the trim tool, and separate BIM objects into another thing entirely - something that perhaps allows you to assign it a geometry as a shape representation)
"There are many ways to obtain the same result" is basically a given in any CAD program. All programs of this kind include many different tools to create shapes, duplicate them, arrange them, apply transformations, extrude them, cut them, apply boolean operations, and everything you can think of. There are many paths for creating the same solid shape, although some methods may be preferred to others, especially if you want to imitate the process of manufacturing of that object in real life, or if you want to easily modify the object in the future.
2. For the first two, it is hard to change the direction of the extrude, I have to set the direction to "custom" in an extrude, because the normal is not immediately visible, similarly for structure I have to numerically type something in to flip the extrusion direction.
3. For the first two, it is quite hard to "rapidly" extrude. I have to think about dimensions and directions and have to fill out a form just to do a simple task, I can't just draw something roughly then fix it later.
For Part Extrude you don't have to set the direction to Custom, you can just set Reversed to true so it flips directions. With Arch Structure you do have to change the Normal property to (0,0,1) if you want it to go to the +Z direction, instead of the -Z direction. This is a bit cumbersome, but it's not a problem.

I don't get what you say about rapidily extruding with Arch Structure. That's exactly what it does. You just select a profile, hit Structure, and it creates a basic extrusion. And you can quickly change the direction of the extrusion (Normal), and Height easily from the property view.

Personally, I would suggest you to avoid the Part Workbench tools if possible; that includes the Part Extrude tool. The Part workbench is essentially a basic interface to the internal OCCT geometry kernel, which is the drawing library that actually draws the shapes and computes the solids.

The Part workbench provides basic solids and boolean operations so you can build a bigger solid by combining those basic shapes. This is a traditional modelling paradigm that is called constructive solid geometry (CSG); see Manual:Traditional modeling, the CSG way. However, in more recent years, programs like Catia, SolidWorks, and FreeCAD, prefer the paradigm of parametric modelling with feature editing, which means starting with a sketch, extruding that sketch with a PartDesign Pad operation, and then adding features on top of the previous body (Basic Part Design Tutorial 017). So, if you consider Pad, there is a fourth option to extrude a face. In general, I suggest using the Part Workbench only to create simple solids like Cubes and Cylinders; for anything more advanced I think you should use PartDesign.

If you look at the code of Draft and Arch tools, you quickly realize that internally they just call Part functions, because eventually every object that you see on screen is a shape created by the OCCT kernel, which is exposed by the Part Workbench. For example, if you look at the type of a solid created with Part Extrude and Draft Trimex, you realize that both of them are 'Part::Extrusion'.

Code: Select all

print(App.ActiveDocument.Extrude.TypeId)
print(App.ActiveDocument.Extrusion.TypeId)
This is part of the code for Draft.extrude(), which is used by the DraftTools.Trimex() tool. It's basically a Part Extrude.

Code: Select all

def extrude(obj,vector,solid=False):
    ...
    newobj = FreeCAD.ActiveDocument.addObject("Part::Extrusion","Extrusion")
    newobj.Base = obj
    newobj.Dir = vector
    newobj.Solid = solid
    ...
    return newobj
So, internally they are the same but the path to achieve the result varies slightly. In particular, it seems that the Trimex() class creates a shape called the "ghost", which shows the tentative figure of the extruded shape. I couldn't find it, but probably the ArchStructure._Structure() class creates Part objects in a similar way, although without a ghost, as it just shows the resulting extrusion immediately.
4. I think the "trim" tool works for top-down profiles, but it doesn't work for side profiles?

Maybe I am missing something?
Of course Draft Trimex works for side profiles.

As you can see in the image, there are many ways to extrude things in FreeCAD. The way I see it, if you are working in architectural design, as Arch loads Draft, you should do as much as possible with the Draft tools (in this case, Trimex), and avoid using equivalent functions of Part.

The functions from the Arch Workbench are interesting in that you can use any existing solid object previously created with Part, PartDesign, or Draft (Trimex). What Arch does is create a layer on top of the already existing shape and sets some properties which are useful in Arch (Base, CloneOf, Additions, Subtractions, IfcRole, Material, VerticalArea, HorizontalArea, etc.). If the solid shape doesn't already exist, for example, it's a 2D wire, then Arch is intelligent enough to create a solid body out of it. However, if you already created a solid object with PartDesing (a curved wall, for example), you can just use Arch Structure to immediately turn that object into a Structure.

This means, it's entirely possible to produce a Trimex the way you like (Extrusion001), and immediately convert the result to a Structure (Structure004), Wall, Roof, Equipment, or other Arch object. The same you can do with PartDesign (Body, and Structure005). This is an entirely normal way of working. From the exterior, from an IFC file, the object will look like a Structure, however, internally, you can modify the base shape with whatever tool you want, for instance, Draft Trimex or PartDesign Pad.

In my Arch workflow I try to create everything with Draft Wires, and then use Arch Wall or Arch Structure to extrude the shape. However, if a particular shape is easier to create with Draft Trimex or with PartDesign, then I do that, but still contain the resulting shape in a Wall or Structure.
Arch_Structure_extrusion.png
Arch_Structure_extrusion.png (189.11 KiB) Viewed 829 times
Attachments
12_extrusion.FCStd
(41.4 KiB) Downloaded 27 times
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply