How to smooth curves or lines?

Next
 From:  tramfreak (IBBA)
10790.1 
Hi,
When I trace curves or lines through points, I get wavy lines that have to be smoothed out piece by piece, which is laborious and time-consuming. Is there an easier way to do this?
Bodo-Lutz
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10790.2 In reply to 10790.1 
Hi Bodo-Lutz, it would be easier to give advice if you could post an example of the problem.

But usually it is best to use the "Control points" version of curve drawing instead of "Through points" especially for placing many points and reducing wiggles.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tramfreak (IBBA)
10790.3 In reply to 10790.2 
Hi Michael.
the file represents half of a windscreen. The boundary lines are to be smoothed out for manufacturing reasons.
few smal parts have already been processed.
Regards Bodo-Lutz

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10790.4 In reply to 10790.3 
Hi Bodo-Lutz, how were the boundary lines initially created? Because they are indeed extremely dense and wiggly:



I would probably use Edit > Lock on the wiggly curve and then draw in a new one over top of it, editing control points to make it come close to the wiggly one, like this (3DM file attached):



- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Phiro
10790.5 
Use the Rebuild function or the ReconstructCurve script.

Rebuild is a MoI included function, but hidden. Select your curve, type TAB and then type Rebuild <enter>
ReconstructCurve is a script not included in MoI.


You have a 2830 points curve when your curve could be defined well with 20 points.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
10790.6 
Here is the Savitzky–Golay filter method that might help. (?)
"The method has been extended for the treatment of 2- and 3-dimensional data."

https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter

The math looks tough, but might be comprehensible with much study.
3rd and 4th derivatives?
Looks like javascript would not be adequate for 3D. (?)
There are two Convolution Coefficient Calculator software packages available for free download.
No Idea how NURBS formulas would apply.

Found all kinds of weird names and topics with a search of Smoothing Curves.

- Brian

The other day, read article about why windshields have those dot/shading patterns, near edges.

EDITED: 28 Jul 2022 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tramfreak (IBBA)
10790.7 
Dear all,

many thanks for your help!
First I will use curve corrected by Michael. Thanks for this!
Also very interesting is the method of Phiro, but how do I get these features out of hiding?
- Bodo-Lutz
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Zooen
10790.8 
Hello,
Would it be possible to modify the "Rebuild" script so that the reconstructed curve automatically takes the default active color or another color than that of the original curve?
The "ReconstructCurve" script, on the other hand, sets the color of the original curve to locked color and sets the color of the reconstructed curve to the default color automatically!

I may not be very clear in my explanation!!!

- Zooen
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10790.9 In reply to 10790.8 
Hi Zooen,

re:
> Would it be possible to modify the "Rebuild" script so that the reconstructed curve automatically
> takes the default active color or another color than that of the original curve?

Yes it's possible to modify the Rebuild script to do that.

You would need to edit the Rebuild.js script inside of MoI's commands folder.

Near the end of the script there is a call to factory.commit(); , you would need to add in this line right before the call to factory.commit() :

code:
	factory.getCreatedObjects().setProperty( 'styleIndex', moi.geometryDatabase.activeStyle );
	
	factory.commit();

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
10790.10 In reply to 10790.8 
A few years ago, with Michael's help, I did some different color curves in JacobianFunctionGraphMod script.
This might help with styleIndex script code.

- Brian

And maybe color change in another script, cannot remember.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Zooen
10790.11 In reply to 10790.9 
Thanks Michael,
Excellent, This simplifies my work and makes it easier for me to compare the original curve and the reconstructed curve when I apply a tolerance of 0.001 for example or a high number of points (the two curves being very close).

- Zooen

Everything that is imagined and invented is true, you can be perfectly sure of it.

EDITED: 6 Aug 2022 by ZOOEN

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All