The NormalProjection declaration is used to project a wire, path, or design onto a surface. To use it specify face to project onto as the shape and embed all the paths to project as children of the node.

# Created in DeclaraCAD
from declaracad.parts.display import Axis
from declaracad.occ.api import *

enamldef Assembly(Part):
    Axis:
        pass
    Loft: surf:
        color = 'gray'
        BSpline:
            points = [(-5, 0, 1), (-5, 5, 4), (-5, 10, 2)]
        BSpline:
            points = [(0, 0, 1), (0, 5, 5), (0, 10, 2)]
        BSpline:
            points = [(5, 0, 1), (5, 5, 4), (5, 10, 2)]
    Circle: circle:
        color = 'lime'
        radius = 5
        position = (0, 5, 10)

    NormalProjection:
        color = 'purple'
        shape = surf.topology.faces[0]
        Transform:
            shape = circle

DeclaraCAD normal projection

Surface mapping

NormalProjection can be used along with a surface map to do engraving / machining on uneven surfaces.

This exaggerated example below projects an svg design generated in Inkscape onto a surface map.

    NormalProjection:
        shape = surf
        Svg:
            source = '~/Pictures/pawprints.svg'

DeclaraCAD surface mapping