I am trying to figure out a way to code an algorithm that lets me know all of the bearing points along a beam or joist. Starting from one end of the joist, it would give me the location of each of the (left and right boundary line) bearing surfaces.

If I can figure out a way to do this I can then put together the engineering for joists and beams and add this functionality into the truss plugin.

An example of a typical simple beam calculation would look something like this:

I think the first step would be to determine the entities or faces that touch or coincide with the face of the bottom of the joist. Once I gather a list of those entities it should be fairly straightforward to intersect each entity with the joist face and then determine the distance from one end of the joist to the perpendicular line(s) that form the boundary of the intersecting entity’s face.

I think the hard part for me is how to find the entities that touch the face of the bottom of the joist.

First I advise that each real world object be a separate named group (or component instance).
Then call boundingbox_pick using the bounds of the joist and the Pick_Crossing type.

You can create and modify bounding boxes. For example you can create 2d flat bounding box corresponding to the bottom surface of the joist.
This will return the Objects touching the bottom of the joist.
From there you can compute the bearing area and exact location of each bearing using boundingbox.intersect for each support against the joist.

You’d have to work out the plane and point for the bottom face of your joist in world-coordinates. (Probably good to have a bounding box in world coordinates to do fast and early filtering.)
Then work out the world coordinate plane of the faces you are comparing against. When the planes match you can then start to check if the polygons intersect.

Boundingbox.intersect, I should have mentioned, results in the bearing area only where the groups are aligned with the global axes as in your example.

For a more general solution you don’t need to do worry about group transforms or world coordinates as long as your groups are solids (is_manifold?) here are the steps:

start_operation.

boundingbox.pick to find supporting groups.

move joist minus one inch in the Z

for each support do a group.subtract against your joist. The group.volume of the resulting boolean difference group is your bearing area. Assign the Points3Ds and transform of the result group to variables if you want to recreate the geometry of the bearing face…