Sweep a selected sketch along a path or to other profiles

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Sweep a selected sketch along a path or to other profiles

Post by chrisb »

Thanks for your input and good luck!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Sweep a selected sketch along a path or to other profiles

Post by NormandC »

Hello Pascal,

plgarcia wrote: Sat Oct 27, 2018 7:56 pm I have made this decision to have a look to another software as SolidCAD, Blender, Fusion360, Blender
Never heard of SolidCAD. In fact I can't find any such CAD program. Blender is not a CAD program, it produces mesh models rather than CAD models, so it might create issues depending on how you plan to manufacture your robotic hand (with 3D printing it would be OK, but not with mass-production processes). I hear Fusion360 is quite popular and capable, but keep in mind that it's a proprietary program, it might be free for personal use, but you're basically hostage to the company's whims which can change the terms of use at any time. Just ask Onshape users. So I recommend making a backup of your project in a neutral format like STEP, just in case. You'd lose history but at least you'd have the basic shape.

You might want to take a look at MoI (Moment of Inspiration), it's not free but it's affordable, and quite capable with complex shapes. I don't think it's parametric though. It only runs on Windows and macOS, but since you mentioned Fusion360 I'm guessing you're using either OS.

Its latest Beta has a very interesting function for polygon sub-d surface to NURBS conversion. In other words: take a polygon mesh (for example created in Blender), convert it to real NURBS surfaces.

plgarcia wrote: Sat Oct 27, 2018 7:56 pm FreeCAD falls into traps, as these tangent faces that are really a pain and that occur to often to be considered as a simple glitch.
These are mostly upstream issues with the OpenCascade (OCC) kernel, it's a third-party software library over which the FreeCAD team has no control.

Good luck.
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: Sweep a selected sketch along a path or to other profiles

Post by plgarcia »

Hello,
I I have chosen FreeCAD at some point in time, it is because it is a paremetric cad and provide many functions and a quite efficient interface.

I know exactly what a cad is, and what Blender is not. But nevertheless Blender can make part of the job, and I can control quite precisely what I am doing with it If I script what I am doing. What also could be done with OpenSCAD.

I also know SolidCAD, Fusion360 and many other software are proprietary, what I do not like, and there are not even Free.

I Thank for all advises you gave, other softwaes, saving in neutral formats, etc.
I always avoid (when possible) software that isnot able to run on Linux, because I do not want to be constrained and have any other choice than using Windows.

The argument of OpenCascade problem is understandable, but not acceptable as a failure of OpenCascade make FreeCAD fail. When you make a project, more if you are a professional, you do not want to know why it does not work and will never, you want to do your stuff and be certain you will come to the end in a quite efficient way. You do not want not to encounter problems, you want them not too be to many, and have always have a workaround.

If the project does not make an effort to isolate OpenCascade interface, and hide it behind an agnostic API to be defined, FreeCAD will never become reliable enough.

There are some errors that could be corrected in this API before calling OpenCascade. Examples:
- Objects with only one point or one line can be removed from the list of objects for a fusion.
- A fusion with only one object is the object himself
- Intersection with a non solid object (point, lines, ...) is empty.
- ...
There are many rules that could be implemented before calling OpenCascade.
An extra word on that: I made some animations that were failing at some point, because the parts were not intersecting during some phase of the simulation, event if mathematically speaking the operations were valid.

The problem with the tangent faces is the worst problem. Either OpenCascade could accept to change and evolve, or when this agnostic API is defined, there could be different implementations with different product, and eventually using the different products depending on the operation.

OpenCascade is really great for many things and It would probably be an error to just ban it.

Again : I have not been able to finalize my project with FreeCAD. It is not that it is impossible, it is that at each I encounter problems I can hardly identify. And when a step is passed I encounter other problems in next step. An when I come to an end, and i want to change something in the design, then new problem raise because tangent faces appear somewhere else.

I propose the following:
OpenSCAD is simple to use but have many problems in preview, and does not rely on OpenCascade.
Hopefully I will be able to build a script of the part I am trying to builds with FreeCAD and provide it as example.
Up to the team to make FreeCAD able to model it!


Regards
Pascal Garcia
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: Sweep a selected sketch along a path or to other profiles

Post by plgarcia »

Here is the OpenSCAD script.
Capture700.JPG
Capture700.JPG (101.57 KiB) Viewed 1752 times
I made duplicates, the manifold is not valid. It is not practical, the software is slow.There is still some job to be done.
But it is almost there in a couple of hours.

There are many tangent faces etc.

Code: Select all

eps=0.01;
length = 50.5;
ray1 = 5.0;
ray2= 0.5;
rayout = ray1+ray2;
$fn=90;
al=45;
ray3=ray1*(1+cos(al))/(1-cos(al));
decl=(ray1+ray3) * sin(al);
/* */
difference () {
    union() {
        difference() {
            cylinder(h=length, r=rayout, center = true );
            
            translate( v = [0, 0, length/2])  
            rotate (a = 50, v = [0,1,0]) 
            translate( v = [ray1*2, 0, 2 * ray1])  
            cube(size= ray1*4, center=true );

            translate( v = [0, 0, -length/2])  
            rotate (a = 40, v = [0,1,0]) 
            translate( v = [ray1*2, 0, 2 * ray1])  
            cube(size= ray1*4, center=true );
        }
        translate( v = [0, 0, length/2]) sphere(r=rayout, $fa=1, $fs=1, center = true);
        translate( v = [0, 0, -length/2]) sphere(r=rayout, $fa=1, $fs=1, center = true);
    }
    
    translate (v = [0, rayout+2*ray2, 0]) cube([2*rayout+eps, 2*rayout+eps, length + 3*ray1], center = true);
    difference () {
        union () {
            translate( v = [0, 0, length/2]) sphere(r=rayout+0.01, $fa=1, $fs=1, center = true);
            translate( v = [0, 0, -length/2]) sphere(r=rayout+0.01, $fa=1, $fs=1, center = true);
        }
        translate (v = [0, -rayout, 0]) cube([2*rayout, 2*rayout, length + 3*rayout], center = true);
       
    }
      
    translate (v = [0, -ray2, length/2]) 
    rotate (a = 180, v = [0,0,1])
    rotate (a = 90, v = [1,0,0])
    {
        rotate_extrude(angle = 180+al, convexity = 10) translate(v = [ray1, 0, 0]) {
            circle(r = ray2);
            translate (v = [0, 2*ray2, 0]) circle(r = ray2);
            translate (v = [0, -ray2, 0]) square(size = 4* ray2);
        }
        
        translate (v = [ray1 - ray3, -decl, 0])    
        rotate_extrude(angle = al, convexity = 10) translate(v = [ray3, 0, 0]) {
            circle(r = ray2);
            translate (v = [0, 2*ray2, 0]) circle(r = ray2);
            translate (v = [-ray2, -ray2, 0]) square(size = [ray2,4*ray2]);
        }
        
        translate(v=[ray1,-length/2,0])
        rotate (a = 90, v = [1,0,0] )
        cylinder(h=length+eps, r=ray2, center = true );
        
        
        translate(v=[ray1,-length/2,2*ray2])
        rotate (a = 90, v = [1,0,0] )
        cylinder(h=length+eps, r=ray2, center = true );
        
        translate(v=[ray1+2*ray2,-length/2,ray2])
        cube(size = [ray2*4 ,length, ray2*4], center=true );

        translate (v=[0 , -length, 2*ray2])
        rotate (a=180, v=[1,0,0]) {
            rotate_extrude(angle = 180+al, convexity = 10) translate(v = [ray1, 0, 0]) {
                circle(r = ray2);
                translate (v = [0, 2*ray2, 0]) circle(r = ray2);
                translate (v = [0, -ray2, 0]) square(size = 4* ray2);
            }
            
            translate (v = [ray1 - ray3, -decl, 0])    
            rotate_extrude(angle = al, convexity = 10) translate(v = [ray3, 0, 0]) {
                circle(r = ray2);
                translate (v = [0, 2*ray2, 0]) circle(r = ray2);
                translate (v = [-ray2, -ray2, 0]) square(size = [ray2,4*ray2]);
            }
        }
    }
}
Last edited by plgarcia on Tue Oct 30, 2018 9:15 am, edited 1 time in total.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: Sweep a selected sketch along a path or to other profiles

Post by chrisb »

You are very right: much has to be done and much can be done. But FreeCAD has very limited development resources.

"Not acceptable" is a big word. Many forum members have accepted it, so it is acceptable for their purposes. I have accepted it the way it is and I'm happy with every improvement. And it it improves rather fast. Have a look at the development since 0.17: Very much has been achieved, although not in the area which would have been perferred by you. If you want that, you have to do it yourself.

Changing to another graphics kernel than OCC might be a good idea, but the proposal might be a toothless tiger:
- Is there a replacement out there?
- How much effort will it take to move?
- Whats going to be worse than before?

In the meantime we know the flaws of OCC pretty well, and that has quite some worth.

If you want help for your project it is always a good idea to show the goal you want to reach, and not only intermediate tasks. Then someone might come up with a completely different approach.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: Sweep a selected sketch along a path or to other profiles

Post by plgarcia »

The concept of FreeCAD is very good, there is no point about that.

See simply the OpenSCAD script. It is very simple somehow, fusions, cuts and intersections of a certain number of primitives:
- Torus
- cubes
- spheres
- cylinders

FreeCAD should be able to do that in an even simpler way, but is not yet! We should solve that if we want FreeCAD to become a reference software.

The point is not to explain the causes, or eventually negate some problems. The point is really do we want to solve these problems? Do we make the decision to solve that?
If the answer is yes, I am your man!
If the answer is no, to my mind it is simple FreeCAD has no future.

Solving many problem I faced need structural decision, and you cannot just tell me do it yourself. If I make structural changes they will not be accepted.

I will again state the same thing: What is really missing in FreeCAD is a committee having a full view on the software who decide and make the decisions in mater of architecture. Somebody doing things on his own may introducing constraints, and may make something not working.

Of course the developer must have some freedom (unless they will not invest themselves and work), but when there is a decision on architecture the decision must be more collegial, to make a good and commonly widely accepted decision.

I have 2 pending PR:
1 - A little improvement absolutely not major about the policy naming the archives, with a compatibility with the actual function, but that reports when an error occurs, and solving a problem when a software as GoogleDrive induce a delay in deletion of files. No risk! Not included since last December 2017.
2 - A correction and improvement of the drags and drops in the tree view that induces corruption in the data structure (a major thing!). Still waiting since last spring.

I have started to work on this problem of colors lost. At this occasion I have acquire a certain knowledge on how at least some of the parts are handled and what is the role of OpenCascade. I known how to correct number of problems on cuts, fusions, intersections due to OpenCascade and by the way extend the capabilities, but not the tangent problems unfortunately that are really an internal OpenCascade issue. I have a certain view do to isolate the call to OpenCascade (the code is already quite well located), to prepare its replacement. I have identified problems in the architecture to be modified prior to solve the problem of colors. Without that the colors problems can not be solved. Architecture problem that also induces performances problem, even if some negate that.

I state it clearly here the software needs some rework to reorganize the different objects and inheritance, and to reorganize the propagation of events.

But changing architecture must be done step by step, each step being compatible with the previous one, and not too be to be revert-able and not to loose the control. That is a big work. But prior to that I need the validation and approval of the persons who incorporate the changes (or not in my two pending PR). I need everybody understands that to do that there will be many steps needed and waiting many months to incorporate the changes of each step will make this effort useless. And I do not want to spend hundreds of hours if I do not have the certainty my contribution will be useful, accepted and incorporated (after review and correction of course my code is not perfect).

First we define what is to be done together, and after I will invest in developing in the accepted contribution.

If we do so I will be a significant contributor!

Regards
Pascal Garcia
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Sweep a selected sketch along a path or to other profiles

Post by Jee-Bee »

plgarcia wrote: Mon Oct 29, 2018 8:43 pm I have 2 pending PR:
1 - A little improvement absolutely not major about the policy naming the archives, with a compatibility with the actual function, but that reports when an error occurs, and solving a problem when a software as GoogleDrive induce a delay in deletion of files. No risk! Not included since last December 2017.
2 - A correction and improvement of the drags and drops in the tree view that induces corruption in the data structure (a major thing!). Still waiting since last spring.
Wmayer is the one who knows most about FC and when he tinks it have to wait... it waits...
I can imagine this is frustating!!
If you want it merged what i understand is ask him what's wrong ... how it can be improved so it can be merged.
My only comment is remove F5 as refresh/ recompute since this is a windows only thing. Swap to Ctrl+R would be much better!!
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: Sweep a selected sketch along a path or to other profiles

Post by plgarcia »

F5 is already present. It recomputes every thing that is marked to recompute.

I added the Ctrl-F5 that marks to recompute and launch recompute.

What can be done in 2 steps before can be done in one step. That is it.

Shall I remove the Ctrl-F5?

But that was not the purpose. This example was only here to state that these delays are not compatible with the magnitude of that task!

The main purpose was:
- How to define the structural changes (what committee to define and accept it)?
- Agree on a incremental process to implement these changes.
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: Sweep a selected sketch along a path or to other profiles

Post by plgarcia »

Obviously there are conflicts to be solved.
I will do that later.
Regards
plgarcia
Posts: 310
Joined: Wed Jun 17, 2015 9:47 pm
Location: Near Paris (France)

Re: Sweep a selected sketch along a path or to other profiles

Post by plgarcia »

Misunderstood your remark about F5. ^R on mac!
Post Reply