package d2isometricimg

import 

// One retained surface can cover hundreds of mesh triangles and also cast a
// shadow. Serialize its vectors once per export, then reuse the same definition
// through each geometry/lighting transform; paper patterns stay vector artwork.
func ( *nativeSVGWriter) ( *nativeVectorSurface) string {
	if .err != nil {
		return ""
	}
	if .surfaces == nil {
		.surfaces = make(map[*nativeVectorSurface]string)
	}
	if  := .surfaces[];  != "" {
		return 
	}
	 := fmt.Sprintf("surface-%d", len(.surfaces))
	,  := nativeSurfaceSVG(.ctx, , +"-")
	if  != nil {
		.err = 
		return ""
	}
	.write(`<defs><g id="%s">%s</g></defs>`, , )
	if .err != nil {
		return ""
	}
	.surfaces[] = 
	return 
}