mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-05 20:06:25 +00:00
Total float calculation now takes into account calendar
This commit is contained in:
@@ -60,14 +60,11 @@ class Usecase:
|
|||||||
else:
|
else:
|
||||||
vx = vz.cross(X_AXIS)
|
vx = vz.cross(X_AXIS)
|
||||||
vy = vx.cross(vz)
|
vy = vx.cross(vz)
|
||||||
tM = Matrix([
|
tM = Matrix(
|
||||||
[vx.x, vy.x, vz.x, co.x],
|
[[vx.x, vy.x, vz.x, co.x], [vx.y, vy.y, vz.y, co.y], [vx.z, vy.z, vz.z, co.z], [0, 0, 0, 1]]
|
||||||
[vx.y, vy.y, vz.y, co.y],
|
).inverted()
|
||||||
[vx.z, vy.z, vz.z, co.z],
|
|
||||||
[0, 0, 0, 1]
|
|
||||||
]).inverted()
|
|
||||||
|
|
||||||
return any([abs((tM @ v.co).z) > threshold for v in face.verts])
|
return any([abs((tM @ v.co).z) > threshold for v in face.verts])
|
||||||
|
|
||||||
def evaluate_geometry(self):
|
def evaluate_geometry(self):
|
||||||
for modifier in self.settings["blender_object"].modifiers:
|
for modifier in self.settings["blender_object"].modifiers:
|
||||||
|
|||||||
@@ -242,7 +242,14 @@ class Usecase:
|
|||||||
elif data.get("late_start") is None:
|
elif data.get("late_start") is None:
|
||||||
data["late_start"] = self.offset_date(data["late_finish"], -data["duration"], data)
|
data["late_start"] = self.offset_date(data["late_finish"], -data["duration"], data)
|
||||||
|
|
||||||
data["total_float"] = data["late_finish"] - data["early_finish"]
|
if data["duration_type"] == "WORKTIME":
|
||||||
|
data["total_float"] = datetime.timedelta(
|
||||||
|
days=ifcopenshell.util.sequence.count_working_days(
|
||||||
|
data["early_finish"], data["late_finish"], data["calendar"]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
data["total_float"] = data["late_finish"] - data["early_finish"]
|
||||||
|
|
||||||
# Waiting for yassine to confirm relationships
|
# Waiting for yassine to confirm relationships
|
||||||
# data["free_float"] = min([self.g.nodes[s]["early_start"] for s in successors])
|
# data["free_float"] = min([self.g.nodes[s]["early_start"] for s in successors])
|
||||||
|
|||||||
Reference in New Issue
Block a user