MCPcopy Index your code
hub / github.com/CadQuery/cadquery / fixed_axis_cost

Function fixed_axis_cost

cadquery/occ_impl/solver.py:510–526  ·  view source on GitHub ↗
(
    problem,
    m1: gp_Dir,
    T1_0,
    R1_0,
    T1,
    R1,
    val: Tuple[float, float, float],
    scale: float = 1,
)

Source from the content-addressed store, hash-verified

508
509
510def fixed_axis_cost(
511 problem,
512 m1: gp_Dir,
513 T1_0,
514 R1_0,
515 T1,
516 R1,
517 val: Tuple[float, float, float],
518 scale: float = 1,
519):
520
521 m1_dm = ca.DM((m1.X(), m1.Y(), m1.Z()))
522 m_val = ca.DM(val) / ca.norm_2(ca.DM(val))
523
524 dummy = Rotate(m1_dm, R1_0 + R1) - m_val
525
526 return ca.sumsqr(dummy)
527
528
529def fixed_rotation_cost(

Callers

nothing calls this directly

Calls 1

RotateFunction · 0.85

Tested by

no test coverage detected