Geometry: Allow to copy point with floating point string format '*,*'.

setup.py
Pierre-Antoine Rouby 2024-01-16 14:20:48 +01:00
parent 0d88b954d8
commit 8834afa4f3
1 changed files with 8 additions and 3 deletions

View File

@ -212,12 +212,17 @@ class ProfileXYZ(Profile, SQLSubModel):
return profile return profile
def point_from_data(self, header, data): def point_from_data(self, header, data):
def float_format(s: str):
return float(
s.replace(",", ".")
)
point = None point = None
try: try:
if len(header) == 0: if len(header) == 0:
x = float(data[0]) x = float_format(data[0])
y = float(data[1]) y = float_format(data[1])
z = float(data[2]) z = float_format(data[2])
name = data[3] if len(data) == 4 else "" name = data[3] if len(data) == 4 else ""
point = PointXYZ( point = PointXYZ(