Text and Paths for Pict3D
die-cut
die-cut-text
die-cut-text/  size
die-cut-path-datum
7.7

Text and Paths for Pict3D

The pict3d-die-cut library creates 3-dimensional cut-outs as Pict3Ds, including cut-outs for text or other drawing paths created with dc-path%.

procedure

(die-cut dc-path    
  [#:depth depth    
  #:top? top?    
  #:bottom? bottom?    
  #:sides? sides?    
  #:expected-scale expected-scale])  pict3d?
  dc-path : dc-path%
  depth : real? = 1.0
  top? : any/c = #t
  bottom? : any/c = #f
  sides? : any/c = #f
  expected-scale : real? = 1.0
Produces a Pict3D version of dc-path by creating a solid face that matches the region bounded by the closed paths of dc-path. Since drawing coordinates and 3-D coordinates are flipped, the resulting 3-D object extends in the negative y-direction the same amount that the path extends in the positive y-direction. The 3-D object starts in the z-origin plane and extends in negative z-direction by depth.

The top?, bottom?, and sides? arguments determine whether the text, its reverse side, and the sides (in the z-direction) are included in the result.

If dc-path contains any curves, they will be approximated by line segments. The expcted-scale argument determines the scale at which line segments replace curves.

procedure

(die-cut-text text    
  [#:font font    
  #:combine? combine?    
  #:center? center?    
  #:depth depth    
  #:top? top?    
  #:bottom? bottom?    
  #:sides? sides?    
  #:expected-scale expected-scale])  pict3d?
  text : string?
  font : (is-a/c font%) = (make-font)
  combine? : any/c = #f
  center? : any/c = #f
  depth : real? = 1.0
  top? : any/c = #t
  bottom? : any/c = #f
  sides? : any/c = #f
  expected-scale : real? = 1.0
Uses die-cut on a path constructed with text-outline in dc-path% given font, text, and combine?.

If center? is #f, the top-left of the text is at the origin in the z-origin plane, which means that the text extends in the positive x-direction and negative y-direction. If center? is #t, the text is centered at the origin, instead.

Changed in version 1.1 of package pict3d-die-cut: Added the #:center? argument.

procedure

(die-cut-text/size text 
  [#:font font 
  #:combine? combine? 
  #:center? center? 
  #:depth depth 
  #:top? top? 
  #:bottom? bottom? 
  #:sides? sides? 
  #:expected-scale expected-scale]) 
  
pict3d? real? real?
  text : string?
  font : (is-a/c font%) = (make-font)
  combine? : any/c = #f
  center? : any/c = #f
  depth : real? = 1.0
  top? : any/c = #t
  bottom? : any/c = #f
  sides? : any/c = #f
  expected-scale : real? = 1.0
Like die-cut-text, but returns the text width and height (within its plane) in addition to the generated Pict3D.

Added in version 1.1 of package pict3d-die-cut.

procedure

(die-cut-path-datum datum    
  [#:depth depth    
  #:top? top?    
  #:bottom? bottom?    
  #:sides? sides?    
  #:expected-scale expected-scale])  pict3d?
  datum : (listof (listof vector?))
  depth : real? = 1.0
  top? : any/c = #t
  bottom? : any/c = #f
  sides? : any/c = #f
  expected-scale : real? = 1.0
Like die-cut, but taking a datum matching the format of the first result produced by get-datum in dc-path%.