Baseball features
The features a baseball surface is drawn from (sportypy._feature_classes.baseball).
BaseBaseballFeature
An extension of the BaseFeature class for baseball features.
The following attributes are specific to baseball features only. For more information on inherited attributes, please see the BaseFeature class definition. The default values are provided to ensure that the feature can at least be created.
Attributes
feature_radius(float): The radius needed to draw the feature. This may not be needed for all features. The default is0.0feature_thickness(float): The thickness with which to draw the feature. This is normally given as the horizontal width of the feature in TV view, however it may be used to specify other thicknesses as needed. The default is0.0field_units(str): The units with which the feature is drawn. The default is"ft"
FieldConstraint
The constraint around the bounding box of the field.
This can be a bit tricky, so large default values are set here.
InfieldDirt
The dirt that comprises the infield.
This includes the base paths, the infield arc, and the home plate circle. The home plate circle may be drawn over in other shapes as needed (example: Detroit's Comerica Park has a home plate shaped dirt area as the home plate "circle")
Attributes
home_plate_circle_radius(float): The radius of the dirt circle surrounding home platefoul_line_to_foul_grass(float): The distance from the outer edge of the foul line to the inner edge of the grass in foul territorypitchers_plate_dist(float): The distance from the front edge of the pitcher's plate to the back tip of home plateinfield_arc_radius(float): The distance from the front edge of the pitcher's mound to the back of the infield dirt
InfieldGrass
The grass that comprises the infield.
This is the area between the basepaths and the outfield that give the infield definition
Attributes
foul_line_to_infield_grass(float): The distance from the outer edge of the foul line to the outer edge of the infield grasshome_plate_circle_radius(float): The radius of the dirt circle surrounding home platebaseline_distance(float): The distance of each baseline
HomePlate
Home plate.
The back tip of home plate will be located at the origin.
Attributes
home_plate_edge_length(float): The length of a full side of home plate
Base
A base on the diamond.
The base is where a runner is considered safe
Attributes
base_side_length(float): The length of one side of a square baseadjust_x_left(bool): Whether or not to adjust the base'sxanchor to the leftadjust_x_right(bool): Whether or not to adjust the base'sxanchor to the right
PitchersMound
The mound from which the pitcher throws.
The pitcher's plate (the rubber) is located on this mound, but is drawn separately
PitchersPlate
The pitcher's plate.
This is also known as the rubber. It is where a pitcher must throw the ball from to start the play
Attributes
pitchers_plate_length(float): The length of the pitcher's plate (the dimension in thexdirection)
BattersBox
The box in which batters stand when batting.
The boxes are located around home plate
Attributes
batters_box_length(float): The length of the batter's box (in theydirection) measured from the outside of the chalk linesbatters_box_width(float): The width of the batter's box (in thexdirection) measured from the outside of the chalk linesbatters_box_y_adj(float): The shift off of center in theydirection that the batter's box needs to be moved to properly align
CatchersBox
The box in which batters stand when batting.
The catcher's box is located behind home plate, connecting to the back edges of the batters' boxes
Attributes
-
catchers_box_depth(float): The distance from the back tip of home plate to the back edge of the catcher's box -
catchers_box_width(float): The distance between the outer edges of the catcher's box -
batters_box_length(float): The length of the batter's box (in theydirection) measured from the outside of the chalk lines -
batters_box_width(float): The width of the batter's box (in thexdirection) measured from the outside of the chalk lines -
catchers_box_shape(str): The shape of the catcher's box. Currently-supported values are:"rectangle"(default behavior)"trapezoid"(seesportypy.surfaces.LittleLeagueFieldfor example)
-
batters_box_y_adj(float): The shift off of center in theydirection that the batter's box needs to be moved to properly align
FoulLine
The lines that designate fair territory from foul territory.
Since a ball on the line is considered in fair territory, the outer edge of the baseline must lie in fair territory (aka the line y = +/- x)
Attributes
is_line_1b(bool): Whether or not the foul line is the first base lineline_distance(float): The length of the foul linebatters_box_length(float): The length of the batter's box (in theydirection) measured from the outside of the chalk linesbatters_box_width(float): The width of the batter's box (in thexdirection) measured from the outside of the chalk linesbatters_box_y_adj(float): The shift off of center in theydirection that the batter's box needs to be moved to properly alignhome_plate_side_to_batters_box(float): The distance from the outer edge of the batter's box to the outer edge of home plate
RunningLane
The running lane along the first base line.
This is entirely in foul territory. The depth should be measured from the foul-side edge of the baseline to the outer edge of the running lane mark
Attributes
running_lane_length(float): The straight-line length of the running lane measured from the point nearest home plate. As an example, if the base lines are 90 feet, and the running lane starts a distance of 45 feet down the line from the back tip of home plate, and extends 3 feet beyond first base, this parameter would be given as48.0running_lane_depth(float): The straight-line distance from the outer edge of the first-base line to the outer edge of the running lanerunning_lane_start_distance(float): The straight-line distance from the back tip of home plate to the start of the running lane