(Using Blender 3.6.8)
The proposed approach is to use a Driver object storing an attribute based on its construction process (e.g. the walls in the question) and a Driven object recovering this attribute to control its own construction process (e.g. the grass).
Driver GeometryNodes modifier
1. Walls are created from an outline made of connected edges, using the nodes with dark grey background.
2. Inner faces, enclosing the "Grass", are tagged using the nodes with dark red background. The approach is to raycast faces onto themself. Top, bottom and outer faces are returning no hit (for more explanations, see Can an object raycast onto itself?). As there is no need to store this information, a simple Capture Attribute
node is used to trigger the raycasting.
3. Edges at "ground" level enclosing the "Grass" are tagged using the nodes with dark green background. Such an edge belongs to an inner face (the previously captured attribute is transferred automatically from Face domain to Edge domain here) And
its Z coordinate is close to 0. The resulting boolean is cached (i.e. it can be used elsewhere) using a Store Named Attribute
node.
Driven GeometryNodes modifier
1. Grass is created as a triangulated surface, using a classical Mesh to Curve
and Fill Curve
nodes sequence.
2. The object (i.e. the walls here) from which is recovered the grass outline is specified through the Group Input
node.
3. This object Geometry (i.e. a data structure with all its characteristics, including attributes) is recovered using an Object Info
node.
4. Only the edges tagged as "ground" previously are kept using a Separate Geometry
node set in Edge domain. The attribute value is recovered with a Named Attribute
node.
Resources: