Function Request - Draw line from equation inside Sketcher

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Function Request - Draw line from equation inside Sketcher

Post by jnxd »

@lordsansui OK I see why discrete lines would suffice for your case. And it seems the different lengths of each of the segment is also intended?
lordsansui
Posts: 45
Joined: Thu Sep 15, 2022 8:54 pm

Re: Function Request - Draw line from equation inside Sketcher

Post by lordsansui »

@jnxd
Yes, the length of each segment will change according to the total length dimension defined by the user inside the sketch but the number segments will be fixed in this case. The equation will adjust the profile. So for each individual design I will need to evaluate how many segments is enough. Other people that want to implement similar functionality needs to do the same.

@abdullah

Considering the fact that I was able to achieve good result for my case, thanks for all contribution, I would still suggest to to think about a Sketcher built-in function, but not as initially suggested, but more in line with the final results achieved here using discrete line (maybe Bspline) so maybe it can reduce the amount of work to be implemented.

The advantages of having a similar function might be:
  • Reduce the amount of constrains needs to define the profile compared to the manual implementation.
  • Reduce time for the user to implement similar cases. If someone need more segments it will take proportionally more time.
  • Improve sketch cleanness due to less constrain showing in the screen.
  • Fast way to increase or decrease the total number of segments. (reducing segment size and increase segment quantity leads to a "continuous curve" as request previously, so maybe a CAP could be defined here, X max points - limited smoothness).
Note: Just to illustrate the CAP/smoothness idea in some CAD software you can define some rendering configuration to speeds up the process witch sometimes results in seeing circle as a polygon. So maybe if the amount of code needed to implement less point is lower than more points, a dev could arbitrary define the CAP.
discrete-curve.png
discrete-curve.png (66.58 KiB) Viewed 261 times
lordsansui
Posts: 45
Joined: Thu Sep 15, 2022 8:54 pm

Re: Function Request - Draw line from equation inside Sketcher

Post by lordsansui »

jnxd wrote: Mon Jan 23, 2023 10:06 am And it seems the different lengths of each of the segment is also intended?
Hello jndx, I was reading again your questions and looks like I didn't understand well the the first time I reply. English isn't my main language.

To make it easier I implement all segments with the same length, I used equality constrain. Different lengths could be used but it would required to add equations in the horizontal lines to to proper define the length and keep them fully constrained. It would also require more tweak in the vertical lines equations too.

The only case I see people using different lengths for each segment would be when they need more smoothness at specific place, where you could concentrate more points. I personally would prefer to have the ability to increase or decrease the total number of points and control overall smooths then having the ability to control segments length.
Post Reply