We propose and describe a working computer implementation for shape grammars that handles embedding relations in two dimensional shapes. The technical framework proposed explores a graph data structure to temporarily represent boundary elements of shapes and how they are assembled. With the associated algorithms, this structure enables a systematic search for parts. The employment of user defined constraints allows for an interactive search. In accordance with the continuous character of shapes, the study puts forth a practical part detection method, which extends to non-deterministic cases.