Code related to the Smooth-Rolling Knots paper. The object files of the knots shown in Figure 3 are available here in both one dimensional .obj and bevelled .stl formats (data/knots/figure_3_knots/no_bevel and data/knots/figure_3_knots/bevel).
where
-
$E_{\text{knot}}$ is a deformation knot energy computed by using a point-to-polyline distance. -
$E_{\text{TDR}}$ is a distance penalty from the smooth-rolling TDRs. -
$E_{\text{curvature}}$ is a curvature energy that penalizes curvature at the junction between the knot's interior and the smooth-rolling TDR's external lobes. -
$w_{\text{knot}}$ ,$w_{\text{curvature}}$ , and$w_{\text{TDR}}$ are user defined weights that control the importance of each term (with fixed$w_{\text{knot}}=1$ ).
See the optimiziation implementation in src/optimization_src/curve_opti.py:optimize_curve_params .
The notebook notebooks/generate_objs.ipynb contains the code and parameters used to generate the knots from Figure 3 from the paper.
curve_opt_params = {
'w_tdr': 1,
'w_curvature': 1,
'curvature_cps': 1,
'tdr_damping': 1,
'n_cps_int_per_seg': 7,
'factor_cps_to_pts': 16,
'max_iter': 400,
}
Parameter description:
w_tdrandw_curvature: weights for the TDR and curvature energy terms.curvature_cps: is a depth factor for which to minimize curvature around the junction points between the TDR and the interior of the knot. It is a multiplier to thefactor_cps_to_ptsparameter, with as a result the number of points centered around the junction to use for the curvature computation.tdr_damping: damping factors for the curvature and TDR energy terms, dissipating the energies in the knot's center. A value of 0 means no damping, 1 means linear damping, 2 means quadratic damping, etc.n_cps_int_per_seg: number of control points per segment in the knot's interior polyline.factor_cps_to_pts: number of points per control point in the knot's polyline.max_iter: maximum number of iterations for the optimization.
The process to find the correct parameters can become quite time consuming for more complex knots. The following recipe has been found to work well:
- Apply the method with
$w_{\text{curvature}}=0$ and$w_{\text{TDR}}=0$ to find then_cps_int_per_segandfactor_cps_to_ptsthat give a good polyline representation of the knot. - Use the
w_tdrandtdr_dampingparameters to find the good TDR vs. knot interior preservation balance. - Apply the
w_curvatureandcurvature_cpsparameters to smooth things out. Curvature minimization isn't local, since we're dealing with polylines.
Notes:
- By giving the optimization more degrees of freedom through 'n_cps_int_per_seg', the smoothness of the knot may be affected. If the knot is not smooth enough, and the curvature weight
w_curvatureis already high, maybe you've increased the number of control points too much. - If the junction curvature minimization affects the interior of the knot too much, increase the
n_cps_int_per_segparameter.
Don't forget to check if
