Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions pooltool/objects/cue/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,42 @@ class CueSpecs:
end_mass:
The mass of the of the cue's end. This controls the amount of deflection
(squirt) that occurs when using sidespin. Lower means less deflection. It is
defined here:
https://billiards.colostate.edu/technical_proofs/new/TP_A-31.pdf.
defined here: https://drdavepoolinfo.com/technical_proofs/new/TP_A-31.pdf.
"""

brand: str = field(default="Predator")
M: float = field(default=0.567)
length: float = field(default=1.4732)
tip_radius: float = field(default=0.0106045) # nickel radius
shaft_radius_at_tip: float = field(
default=0.0065
) # 13 mm shaft diameter at the tip
shaft_radius_at_butt: float = field(default=0.02)
end_mass: float = field(default=0.170097 / 30)
brand: str = field()
M: float = field()
length: float = field()
tip_radius: float = field()
shaft_radius_at_tip: float = field()
shaft_radius_at_butt: float = field()
end_mass: float = field()

@staticmethod
def default() -> CueSpecs:
"""Construct a default cue spec"""
return CueSpecs()
return CueSpecs(
brand="Pooltool",
M=0.567,
length=1.4732,
tip_radius=0.0106045,
shaft_radius_at_tip=0.0065,
shaft_radius_at_butt=0.02,
end_mass=0.170097 / 30,
)

@staticmethod
def snooker() -> CueSpecs:
raise NotImplementedError()
# FIXME: this is just a copy paste of the pool cue specs
return CueSpecs(
brand="Pooltool",
M=0.567,
length=1.4732,
tip_radius=0.0106045,
shaft_radius_at_tip=0.0065,
shaft_radius_at_butt=0.02,
end_mass=0.170097 / 30,
)


@define
Expand Down
Binary file modified tests/events/example_system.msgpack
Binary file not shown.
Binary file modified tests/evolution/event_based/test_data/case1.msgpack
Binary file not shown.
Binary file modified tests/evolution/event_based/test_data/case2.msgpack
Binary file not shown.
Binary file modified tests/evolution/event_based/test_data/case3.msgpack
Binary file not shown.
Binary file modified tests/evolution/event_based/test_data/case4.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/01_test_shot_no_point.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/01a_test_shot_no_point.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/02_test_shot_ispoint.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/02a_test_shot_ispoint.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/03_test_shot_ispoint.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/03a_test_shot_ispoint.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/04_test_shot_no_point.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/04a_test_shot_no_point.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/05_test_shot_ispoint.msgpack
Binary file not shown.
Binary file modified tests/ruleset/test_shots/05a_test_shot_ispoint.msgpack
Binary file not shown.
Loading