def to_python(xml): return { "camera_view_point": XYZ.to_python(xml.find("CameraViewPoint")), "camera_direction": XYZ.to_python(xml.find("CameraDirection")), "camera_up_vector": XYZ.to_python(xml.find("CameraUpVector")), "view_to_world_scale": float(xml.find("ViewToWorldScale").text), }
def to_python(xml): return { "camera_view_point": XYZ.to_python(xml.find("CameraViewPoint")), "camera_direction": XYZ.to_python(xml.find("CameraDirection")), "camera_up_vector": XYZ.to_python(xml.find("CameraUpVector")), "field_of_view": float(xml.find("FieldOfView").text), }
def to_xml(camera): e = builder.ElementMaker() return e.OrthogonalCamera( e.CameraViewPoint(*XYZ.to_xml(camera["camera_view_point"])), e.CameraDirection(*XYZ.to_xml(camera["camera_direction"])), e.CameraUpVector(*XYZ.to_xml(camera["camera_up_vector"])), e.ViewToWorldScale(str(camera["view_to_world_scale"])), )
def to_xml(camera): e = builder.ElementMaker() return e.PerspectiveCamera( e.CameraViewPoint(*XYZ.to_xml(camera["camera_view_point"])), e.CameraDirection(*XYZ.to_xml(camera["camera_direction"])), e.CameraUpVector(*XYZ.to_xml(camera["camera_up_vector"])), e.FieldOfView(str(camera["field_of_view"])), )
def to_xml(line): e = builder.ElementMaker() return e.Line( e.StartPoint(*XYZ.to_xml(line["start_point"])), e.EndPoint(*XYZ.to_xml(line["end_point"])), )
def to_python(xml): return { "start_point": XYZ.to_python(xml.find("StartPoint")), "end_point": XYZ.to_python(xml.find("EndPoint")), }
def to_xml(plane): e = builder.ElementMaker() return e.ClippingPlane( e.Location(*XYZ.to_xml(plane["location"])), e.Direction(*XYZ.to_xml(plane["direction"])), )
def to_python(xml): return { "location": XYZ.to_python(xml.find("Location")), "direction": XYZ.to_python(xml.find("Direction")), }