Quick question. I generated an arc in SketchUp using some Ruby code. I was bug testing, and when I changed the segments in the entity panel, I got some very weird results. The arc generates with 12 segments and generates correctly; it is only until I change the segments that things start to break.
I can confirm the strange behavior when manually change Segments of Arc created by code.
I was able to reproduce it in SU2017 Make, SU 2023, and SU 2022 as shown in the animation. (I drawn two edges in advance to help identifying what is happening)
model = Sketchup.active_model
entities = model.active_entities
center_point = Geom::Point3d.new
# Create an arc perpendicular to the normal or Z axis
normal = Geom::Vector3d.new(0, 0, 1)
xaxis = Geom::Vector3d.new(1, 0, 0)
edges = entities.add_arc(center_point, xaxis, normal, 10, 15.degrees, 135.degrees)
I have no idea. It is a bug in SketchUp code, and needs to be investigated by SketchUp devs.
The error has been there for a long time, but until now no one really noticed it. I don’t know when or if it will be fixed…
Until that, I recommend that you specify the “proper number of segment” when creating the Arc by code
This is a separate bug. I did actually run across that bug in my testing, so it’s still not resolved yet.
EDIT: Actually, I think you just worked it out. The issue is with the start angle, I copied the code snippet dezmo posted but changed the start angle to 0. Once I did this, I was able to change segments without any issue. This bug definitely has something to do with start angles > 0.