Package frc.spectrumLib.sim
Class Circle
java.lang.Object
frc.spectrumLib.sim.Circle
Draws a circle in a
Mechanism2d canvas as a ring of evenly spaced radial ligaments.
RollerSim uses it to show the roller's spin state by color.-
Constructor Summary
ConstructorsConstructorDescriptionCircle(int backgroundLines, double diameterInches, String name, MechanismRoot2d root, Mechanism2d mech) Circle(Mechanism2d mech, int backgroundLines, double diameterInches, String name, MechanismRoot2d root, Color8Bit color) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddrawViz()Appends a white radius line, so the spin direction is visible in the canvas.intvoidsetBackgroundColor(Color8Bit color) voidColor new background lines get when the circle is drawn.voidsetHalfBackground(Color8Bit color8Bit, Color8Bit color8Bit2) Alternates two colors across the radial lines, which reads as a two-tone circle.void
-
Constructor Details
-
Circle
public Circle(int backgroundLines, double diameterInches, String name, MechanismRoot2d root, Mechanism2d mech) -
Circle
public Circle(Mechanism2d mech, int backgroundLines, double diameterInches, String name, MechanismRoot2d root, Color8Bit color)
-
-
Method Details
-
drawCircle
public void drawCircle() -
drawViz
public void drawViz()Appends a white radius line, so the spin direction is visible in the canvas. -
setBackgroundColor
-
setHalfBackground
Alternates two colors across the radial lines, which reads as a two-tone circle.- Parameters:
color8Bit- color for even-indexed linescolor8Bit2- color for odd-indexed lines
-
getCircleBackground
-
getBackgroundLines
public int getBackgroundLines() -
setColor
Color new background lines get when the circle is drawn. -
setName
-