STEP#

ISO STEP reader/writer.

class volmdlr.step.Step(lines: List[str], name: str = '')[source]#

Bases: DessiaObject

Defines the Step class.

property all_connections#

Returns all pairs of connections.

context_dependent_shape_representation_to_next_assembly_usage_occurrence(node)[source]#

Returns id of the next_assembly_usage_occurrence related to the given context_dependent_shape_representation.

create_connections()[source]#

Create connections between step entities.

create_graph()[source]#

Step functions graph.

Returns:

A graph representation the step file structure.

Return type:

networkx.DiGraph

create_node_list(initial_nodes)[source]#

Step functions graph as a list of nodes.

Parameters:

initial_nodes (List[int]) – Initial list of shell nodes and assemblies entities.

Returns:

A list of nodes in the right order of dependency.

Return type:

List[int]

draw_graph(graph=None, reduced=False)[source]#

Draw a graph for Step data.

Parameters:
  • graph (TYPE, optional) – DESCRIPTION, defaults to None

  • reduced (TYPE, optional) – DESCRIPTION, defaults to False

Returns:

DESCRIPTION

Return type:

TYPE

classmethod from_file(filepath: str | None = None, name: str = '')[source]#

Instantiate a Step object from a step file.

classmethod from_stream(stream: BinaryFile, name: str = '')[source]#

Instantiate a Step object from a stream.

get_assembly_data(assembly_usage_occurence, valid_entities, assembly_frame, object_dict)[source]#

Helper function to get assembly data.

get_assembly_structure()[source]#

Get assembly dependency structure.

get_frame_mapped_shell_node(node: int)[source]#

Find the shell node in the assembly.

Parameters:

node (int) – Assembly step entity node.

Returns:

Shell ID.

Return type:

int

get_root_nodes()[source]#

Returns a dictionary containing the nodes of the step file function that are used as start points.

get_shell_node_from_representation_entity(id_representation_entity: int)[source]#

Find the shell node ID related to a given representation entity.

Parameters:

id_representation_entity (int) – Representation entity ID.

Returns:

Shell ID.

Return type:

int

get_shell_node_from_shape_representation(id_shape_representation: int)[source]#

Find the shell node ID related to a given shape representation.

Parameters:

id_shape_representation (int) – Representation entity ID.

Returns:

Shell ID.

Return type:

int

graph()[source]#

Returns the step file networkx graph of dependencies.

instantiate(name, arguments, object_dict, step_id)[source]#

Gives the volmdlr object related to the step function.

instatiate_assembly(object_dict)[source]#
not_implemented()[source]#
parse_arguments(arguments)[source]#

Converts the arguments IDs from string to integer.

plot_data()[source]#

Base plot_data method. Overwrite this to display 2D or graphs on platform.

Should return a list of plot_data’s objects.

product_definition_to_product(id_product_definition)[source]#

Returns the ID of the product entity related to the given product_definition ID.

read_lines(lines)[source]#

Translate the step file into step functions objects.

property root_nodes#

Returns a dictionary containing the nodes of the step file function that are used as start points.

shape_definition_representation_to_product_node(shape_definition_representation_id)[source]#

Returns the ID of the product entity related to the given shape_definition_representation ID.

shape_definition_representation_to_shell_node(shape_definition_representation_id)[source]#

Returns the ID of the shell entity related to the given shape_definition_representation ID.

static step_subfunctions(subfunctions)[source]#

Handles context elements from step file.

to_points()[source]#

Returns a list containing all the points present in a step file.

to_volume_model(show_times: bool = False)[source]#

Translate a step file into a volmdlr object.

Parameters:

show_times (bool) – if True, displays how many times a given class has been instantiated and the total time of all the instantiations of this given class.

Returns:

A volmdlr solid object.

Return type:

volmdlr.core.VolumeModel

class volmdlr.step.StepFunction(function_id, function_name, function_arg)[source]#

Bases: object

Abstract class defining a step function.

classmethod dict_to_object(dict_, *args, **kwargs)[source]#
simplify(new_name)[source]#

ADD DOCSTRING.

to_dict(*args, **kwargs)[source]#

Custom to dict for performance.

class volmdlr.step.StepReaderReport(step_name: str = ' ', total_number_of_faces: int = 0, faces_read: int = 0, sucess_rate: float = 0.0, errors: list = <factory>)[source]#

Bases: object

Data class to save a report after translating a step file to volmdlr object.

errors: list#
faces_read: int = 0#
step_name: str = ' '#
sucess_rate: float = 0.0#
total_number_of_faces: int = 0#