The company plugin’s beam-to-slab function has been updated. The designer requested a feature to split arc beams and align them to the top of the slab.

This article only discusses splitting arc beams; ellipses will be updated later.

  1. First, let’s look at the arc creation API Image Description The API provides three methods: The first one is specifying the start point and end point, and finally selecting a point on the arc. The second one is specifying the plane, radius, start angle, and end angle. The third one is specifying the center point, radius, start angle, end angle, x-vector, and y-vector.

  2. Splitting an arc means that if it encounters a slab boundary, it needs to be split. The arc needs to be divided into two arcs according to the slab boundary. The first method definitely won’t work. The latter two require understanding what start angle and end angle are and how to calculate them.

  3. The following is my understanding. I will add more after completing it completely. It might be a bit messy, fearing that I might forget later (all arcs rotate counterclockwise).

    • There are three parameters inside the arc (xDir, yDir, normal). These three parameters represent the horizontal vector, vertical vector, and normal vector.
    • Below is a comparison of two opposite values. You can see that the normal vector determines the direction of the entire arc on both sides. This can be understood using the right-hand rule. Image Description Image Description
  • That is to say, if arranged conventionally, we can calculate startangle and endangle. The formula is as follows:
 var dir0 = (arc.GetEndPoint(0) - arc.Center).Normalize();
                    var dir1 = (arc.GetEndPoint(1) - arc.Center).Normalize();

Image Description

  • From the figure above, it can be seen that startAngle represented by α is greater than endAngle represented by β. The entire angle size is exactly opposite, so when we split, we can split in the reverse direction to obtain the corresponding new arc.
		double endAngle = dir0.AngleOnPlaneTo(arc.XDirection, arc.Normal);
        double startAngle = dir1.AngleOnPlaneTo(arc.XDirection, arc.Normal);
        double intersectAngle = dir.AngleOnPlaneTo(arc.XDirection, arc.Normal);
  • As mentioned earlier, the relationship between the normal vector and Y follows the right-hand rule.
  • Reversing the combination can form a new arc shape, completing the split.
var fakeNewLine = Arc.Create(arc.Center, arc.Radius, startAngle, intersectAngle, arc.XDirection,
                                -arc.YDirection);
newLine = fakeNewLine.CreateReversed();
var fakeLine = Arc.Create(arc.Center, arc.Radius, intersectAngle, endAngle, arc.XDirection,
                                -arc.YDirection);
 line = fakeLine.CreateReversed();
  • The beam align to slab is not yet completed here. Because we split counterclockwise, we need to reverse the entire arc to complete the final style conversion. Below is the result image: Image Description Image Description