This can be done using `Sketchup::Entities#intersect_with`

, however it modifies the model hence the undo operation. Since SU2020 or so, â€śobjectsâ€ť refer collectively to groups or component instances â€¦

```
# Create a group of intersect edges between two instances.
#
# @param inst1 [Sketchup::Group,Sketchup::ComponentInstance]
# @param inst2 [Sketchup::Group,Sketchup::ComponentInstance]
# @return [Sketchup::Group,nil] A group with intersect edges.
def intersect_objects(inst1, inst2)
unless inst1.parent == inst2.parent
fail(ArgumentError,'argument instances are not in same context.',caller)
end
model = inst1.model
model.start_operation('Intersect Objects',false)
group = inst1.parent.entities.add_group
edges = inst1.entities.intersect_with(
false, inst1.transformation, group.entities, IDENTITY, false, inst2
)
model.commit_operation
return nil if !edges || edges.empty?
group
end
```

From the resultant intersect group, â€¦ or any group you **know** has **only** planar edges â€¦

â€¦ to get an array describing a plane per the `Geom`

model **Overview** â€¦

```
# For a group containing edges, returns a "best fit" plane array
# matched to as many of the vertex positions of the edges as possible.
#
# Does not determine if all edge vertices are planar!
#
# @param group [Sketchup::Group] A group containing intersect edges.
# @return [Array] An array describing the best fit plane.
def intersect_plane(group)
edges = group.entities.grep(Sketchup::Edge)
pts = edges.flat_map(&:vertices).uniq.map(&:position)
# Get best fit plane:
Geom::fit_plane_to_points(pts)
end
```