diff --git a/definer.py b/definer.py index 6d62869..056552b 100644 --- a/definer.py +++ b/definer.py @@ -76,6 +76,8 @@ def draw_arrow(gp_frame, p: tuple, norm: tuple, d: tuple, size: int, reverse: bo return gp_stroke class Anton_OT_DirectionUpdater(bpy.types.Operator): + """Visualizes direction vector of applied force with grease pencil + """ bl_idname = "anton.directionupdate" bl_label = "" @@ -83,6 +85,11 @@ class Anton_OT_DirectionUpdater(bpy.types.Operator): direction_reverse = OrderedDict() def execute(self, context): + """Instantiates an arrow at the centroid of a face on which force is applied. The instantiated arrow is + a grease pencil object whose color corresponds to the applied force. + + :return: ``FINISHED`` if successful, ``CANCELLED`` otherwise + """ scene = context.scene active_object = bpy.data.objects[scene.anton.filename] direction = np.array([0.0, 0.0, 0.0]) @@ -170,11 +177,33 @@ def execute(self, context): return{'CANCELLED'} class Anton_OT_Definer(bpy.types.Operator): + """An operator class that creates a tetrahedral finite element mesh of the model with **gmsh_api**, + interprets the forces acting on the model and stores the required variables as a numpy binary file (.npy). + """ bl_idname = 'anton.define' bl_label = 'Anton_Definer' bl_description = 'Defines the problem.' def execute(self, context): + """Iterates through all the faces of the model and creates sets of face indices. + + :ivar nodes: + :vartype nodes: numpy.array + :ivar elements: + :vartype elements: numpy.array + :ivar fixed_nodes: + :vartype fixed_nodes: numpy.array + :ivar no_design_nodes: + :vartype no_design_nodes: numpy.array + :ivar forced_nodes: + :vartype forced_nodes: numpy.array + :ivar directions: + :vartype directions: OrderedDict + :ivar distributed_force: + :vartype distributed_force: OrderedDict + + :return: ``FINISHED`` if successful, ``CANCELLED`` otherwise + """ scene = context.scene active_object = bpy.data.objects[scene.anton.filename] @@ -187,7 +216,7 @@ def execute(self, context): bpy.ops.object.mode_set(mode='OBJECT') for face in active_object.data.polygons: if 'FIXED' in active_object.data.materials[face.material_index].name_full: - # ADDING 1 COZ OF GMSH INDEX + # Adding 1 because of gmsh_api convention fixed_faces.add(face.index + 1) elif 'NODESIGNSPACE' in active_object.data.materials[face.material_index].name_full: @@ -235,7 +264,6 @@ def execute(self, context): geo_points = OrderedDict() geo_edges = OrderedDict() - # GET POINTS FROM DATA i = 1 for _surface in data: for _vertex in _surface: @@ -244,11 +272,9 @@ def execute(self, context): geo_points[i] = _vertex i += 1 - # GET TRIANGLES FROM DATA for i, _data in enumerate(data): triangles[i+1] = [points[_data[0]], points[_data[1]], points[_data[2]]] - # GET EDGES FROM TRIANGLES i = 1 for _triangle in triangles.values(): for _edge in self.get_edge_indices(_triangle): @@ -257,7 +283,6 @@ def execute(self, context): geo_edges[i] = _edge i += 1 - # GET CURVE_LOOP FROM TRIANGLES for _triangle_id in triangles.keys(): curve_loop[_triangle_id] = [] for connection in self.get_curve_loop(triangles[_triangle_id]): @@ -349,6 +374,45 @@ def create_geo(self, curve_loop, clmax): + """Creates a tetrahedral finite element mesh of the model + + :param path: + :type path: str + :param filename: + :type filename: str + + :param fixed_faces: + :type fixed_faces: set + :param no_design_faces: + :type no_design_faces: set + :param forced_faces: + :type forced_faces: OrderedDict + :param forced_magnitudes: + :type forced_magnitudes: OrderedDict + + :param forced_directions: + :type forced_directions: OrderedDict + :param forced_direction_signs: + :type forced_direction_signs: OrderedDict + + :param points: + :type points: OrderedDict + :param edges: + :type edges: OrderedDict + :param curve_loop: + :type curve_loop: OrderedDict + + :param geo_points: + :type geo_points: OrderedDict + :param geo_edges: + :type geo_edges: OrderedDict + + :param clmax: + :type clmax: float + + :return: nodes, elements, fixed_nodes, no_design_nodes, forced_nodes, directions, distributed_force + """ + geo = gmsh.model.geo lc = clmax @@ -466,7 +530,7 @@ def get_raw_data(path): data.append([]) else: if 'vertex' in line: - # IGNORING NORMALS FOR NOW + # Ignoring normals data[-1].append(tuple(map(float, line[:-1].split(' ')[1:]))) line = f.readline() @@ -480,7 +544,7 @@ def compute_direction(points): return vec/vec_mag @staticmethod - def compute_area(points): + def compute_area(points): v1 = points[1] - points[0] v2 = points[2] - points[0] v3 = np.cross(v1, v2) diff --git a/docs/_build/doctrees/anton.doctree b/docs/_build/doctrees/anton.doctree deleted file mode 100644 index 2393605..0000000 Binary files a/docs/_build/doctrees/anton.doctree and /dev/null differ diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 007101e..6fe7093 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 7bfca02..2b6046e 100644 Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ diff --git a/docs/_build/doctrees/interface.doctree b/docs/_build/doctrees/quickstart.doctree similarity index 86% rename from docs/_build/doctrees/interface.doctree rename to docs/_build/doctrees/quickstart.doctree index 0aed764..e9fbf9d 100644 Binary files a/docs/_build/doctrees/interface.doctree and b/docs/_build/doctrees/quickstart.doctree differ diff --git a/docs/_build/doctrees/scripts.doctree b/docs/_build/doctrees/scripts.doctree new file mode 100644 index 0000000..009aead Binary files /dev/null and b/docs/_build/doctrees/scripts.doctree differ diff --git a/docs/_build/html/_sources/index.rst.txt b/docs/_build/html/_sources/index.rst.txt index e6327a8..6fe25a5 100644 --- a/docs/_build/html/_sources/index.rst.txt +++ b/docs/_build/html/_sources/index.rst.txt @@ -17,8 +17,8 @@ anton is a generative design framework built on Blender, the open-source 3D crea introduction installation - interface - anton + quickstart + scripts release license diff --git a/docs/_build/html/_sources/interface.rst.txt b/docs/_build/html/_sources/interface.rst.txt deleted file mode 100644 index 914293a..0000000 --- a/docs/_build/html/_sources/interface.rst.txt +++ /dev/null @@ -1,2 +0,0 @@ -Interface -========= \ No newline at end of file diff --git a/docs/_build/html/_sources/quickstart.rst.txt b/docs/_build/html/_sources/quickstart.rst.txt new file mode 100644 index 0000000..e397aa5 --- /dev/null +++ b/docs/_build/html/_sources/quickstart.rst.txt @@ -0,0 +1,2 @@ +Quickstart +========== \ No newline at end of file diff --git a/docs/anton.rst b/docs/_build/html/_sources/scripts.rst.txt similarity index 61% rename from docs/anton.rst rename to docs/_build/html/_sources/scripts.rst.txt index 4380a9a..bb839aa 100644 --- a/docs/anton.rst +++ b/docs/_build/html/_sources/scripts.rst.txt @@ -1,59 +1,42 @@ Scripts ======= -Definer --------------------- +Properties +----------------------- -.. automodule:: definer +.. automodule:: properties :members: - :undoc-members: :show-inheritance: + Initializer ------------------------ .. automodule:: initializer :members: - :undoc-members: :show-inheritance: -Panel ------------------- -.. automodule:: panel - :members: - :undoc-members: - :show-inheritance: - -Preferences ------------------------- +Definer +-------------------- -.. automodule:: preferences +.. automodule:: definer :members: - :undoc-members: :show-inheritance: + Processor ---------------------- .. automodule:: processor :members: - :undoc-members: :show-inheritance: -Properties ------------------------ - -.. automodule:: properties - :members: - :undoc-members: - :show-inheritance: Visualizer ----------------------- .. automodule:: visualizer :members: - :undoc-members: :show-inheritance: diff --git a/docs/_build/html/anton.html b/docs/_build/html/anton.html deleted file mode 100644 index bcb4520..0000000 --- a/docs/_build/html/anton.html +++ /dev/null @@ -1,771 +0,0 @@ - - - - - - - - Scripts — anton documentation - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -
-

Scripts

-
-

Definer

-
-
-class definer.Anton_OT_Definer
-

Bases: bpy.types.Operator

-
-
-bl_description: str = 'Defines the problem.'
-
- -
-
-bl_idname: str = 'anton.define'
-
- -
-
-bl_label: str = 'Anton_Definer'
-
- -
-
-static compute_area(points)
-
- -
-
-static compute_direction(points)
-
- -
-
-create_geo(path, filename, fixed_faces, no_design_faces, forced_faces, forced_magnitudes, forced_directions, forced_direction_signs, geo_points, geo_edges, points, edges, curve_loop, clmax)
-
- -
-
-execute(context)
-

Execute the operator

-
-
Parameters
-

context ('Context') –

-
-
Return type
-

typing.Union[typing.Set[str], typing.Set[int]]

-
-
Returns
-

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

-
-
-
- -
-
-static get_curve_loop(surf)
-
- -
-
-static get_edge_indices(surf)
-
- -
-
-static get_raw_data(path)
-
- -
- -
-
-class definer.Anton_OT_DirectionUpdater
-

Bases: bpy.types.Operator

-
-
-bl_idname: str = 'anton.directionupdate'
-
- -
-
-bl_label: str = ''
-
- -
-
-direction_reverse = {}
-
- -
-
-execute(context)
-

Execute the operator

-
-
Parameters
-

context ('Context') –

-
-
Return type
-

typing.Union[typing.Set[str], typing.Set[int]]

-
-
Returns
-

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

-
-
-
- -
-
-force_id: None
-
- -
- -
-
-definer.draw_arrow(gp_frame, p: tuple, norm: tuple, d: tuple, size: int, reverse: bool)
-
- -
-
-definer.get_grease_pencil(gpencil_obj_name='GPencil') → bpy.types.GreasePencil
-
- -
-
-definer.get_grease_pencil_layer(gpencil: bpy.types.GreasePencil, gpencil_layer_name='GP_Layer', clear_layer=False) → bpy.types.GPencilLayer
-
- -
-
-definer.init_grease_pencil(gpencil_obj_name='GPencil', gpencil_layer_name='Annotation_Layer', clear_layer=True) → bpy.types.GPencilLayer
-
- -
-
-

Initializer

-
-
-class initializer.Anton_OT_ForceUpdater
-

Bases: bpy.types.Operator

-
-
-bl_idname: str = 'anton.forceupdate'
-
- -
-
-bl_label: str = ''
-
- -
-
-diffuse_library = [(1.0, 0.0, 0.7803921568627451, 1), (1.0, 0.9725490196078431, 0.0, 1), (0.3254901960784314, 1.0, 0.0, 1), (0.050980392156862744, 0.8549019607843137, 0.5254901960784314, 1), (0.45098039215686275, 1.0, 0.0, 1), (0.0, 0.8509803921568627, 1.0, 1), (0.9215686274509803, 1.0, 0.0, 1), (1.0, 0.6980392156862745, 0.3254901960784314, 1), (0.5803921568627451, 0.050980392156862744, 0.34509803921568627, 1), (1.0, 0.0, 0.5529411764705883, 1), (1.0, 0.5450980392156862, 0.0, 1)]
-
- -
-
-execute(context)
-

Execute the operator

-
-
Parameters
-

context ('Context') –

-
-
Return type
-

typing.Union[typing.Set[str], typing.Set[int]]

-
-
Returns
-

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

-
-
-
- -
- -
-
-class initializer.Anton_OT_Initializer
-

Bases: bpy.types.Operator

-
-
-bl_description: str = 'Makes fixed materials and force vertex groups.'
-
- -
-
-bl_idname: str = 'anton.initialize'
-
- -
-
-bl_label: str = 'Anton_Initializer'
-
- -
-
-execute(context)
-

Execute the operator

-
-
Parameters
-

context ('Context') –

-
-
Return type
-

typing.Union[typing.Set[str], typing.Set[int]]

-
-
Returns
-

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

-
-
-
- -
- -
-
-

Panel

-
-
-class panel.Anton_PT_Panel
-

Bases: bpy.types.Panel

-
-
-bl_category: str = 'anton'
-
- -
-
-bl_idname: str = 'ANTON_PT_panel'
-
- -
-
-bl_label: str = 'anton'
-
- -
-
-bl_region_type: Union[str, int] = 'UI'
-
- -
-
-bl_space_type: Union[str, int] = 'VIEW_3D'
-
- -
-
-draw(context)
-

Draw UI elements into the panel UI layout

-
-
Parameters
-

context ('Context') –

-
-
-
- -
- -
-
-

Preferences

-
-
-class preferences.AntonInstaller
-

Bases: bpy.types.Operator

-
-
-bl_description: str = 'Installs required modules'
-
- -
-
-bl_idname: str = 'anton.installer'
-
- -
-
-bl_label: str = 'Install required modules'
-
- -
-
-execute(context)
-

Execute the operator

-
-
Parameters
-

context ('Context') –

-
-
Return type
-

typing.Union[typing.Set[str], typing.Set[int]]

-
-
Returns
-

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

-
-
-
- -
- -
-
-class preferences.AntonPreferences
-

Bases: bpy.types.AddonPreferences

-
-
-bl_idname: str = ''
-
- -
-
-draw(context)
-
- -
- -
-
-

Processor

-
-
-class processor.Anton_OT_Processor
-

Bases: bpy.types.Operator

-
-
-bl_description: str = 'Start Optimization'
-
- -
-
-bl_idname: str = 'anton.process'
-
- -
-
-bl_label: str = 'Anton_Processor'
-
- -
-
-static compute_Dmat(v)
-
- -
-
-execute(context)
-

Execute the operator

-
-
Parameters
-

context ('Context') –

-
-
Return type
-

typing.Union[typing.Set[str], typing.Set[int]]

-
-
Returns
-

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

-
-
-
- -
-
-material_library = {'ABS-Generic': {'POISSON': 0.37, 'YOUNGS': 2300.0}, 'Acrylic-Glass-Generic': {'POISSON': 0.38, 'YOUNGS': 2550.0}, 'AlMg3F24': {'POISSON': 0.3, 'YOUNGS': 70000.0}, 'AlMgSi1F31': {'POISSON': 0.3, 'YOUNGS': 70000.0}, 'AlZn4-5Mg1F35': {'POISSON': 0.3, 'YOUNGS': 70000.0}, 'Aluminum-6061-T6': {'POISSON': 0.33, 'YOUNGS': 69000.0}, 'CalculiX-Steel': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Concrete-EN-C35_45': {'POISSON': 0.17, 'YOUNGS': 32000.0}, 'Concrete-Generic': {'POISSON': 0.17, 'YOUNGS': 32000.0}, 'Glass-Generic': {'POISSON': 0.22, 'YOUNGS': 72000.0}, 'PA6-Generic': {'POISSON': 0.39, 'YOUNGS': 2930.0}, 'PET-Generic': {'POISSON': 0.36, 'YOUNGS': 3150.0}, 'PLA-Generic': {'POISSON': 0.36, 'YOUNGS': 3640.0}, 'PP-Generic': {'POISSON': 0.44, 'YOUNGS': 1470.0}, 'PTFE-Generic': {'POISSON': 0.46, 'YOUNGS': 564.0}, 'PVC-Generic': {'POISSON': 0.38, 'YOUNGS': 2800.0}, 'Reinforcement-FIB-B500': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-15CrNi6': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-17CrNiMo6': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-1C22': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-1C35': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-1C45': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-1C60': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-20NiCrMo2': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-28Mn6': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-2C10': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-30CrNiMo8': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-34CrNiMo6': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-36CrNiMo4': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-36NiCrMo16': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-3C15': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-3C22': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-3C35': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-3V45': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C10': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C15': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C22E': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C25E': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C30E': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C40E': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C50E': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C55E': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-C60E': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-E295': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-E295-GC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-E335': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-E335-GC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-E360': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-E360-GC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-EN-GJL-100': {'POISSON': 0.3, 'YOUNGS': 88000.0}, 'Steel-EN-GJL-150': {'POISSON': 0.3, 'YOUNGS': 95000.0}, 'Steel-EN-GJL-200': {'POISSON': 0.3, 'YOUNGS': 105000.0}, 'Steel-EN-GJL-250': {'POISSON': 0.3, 'YOUNGS': 115000.0}, 'Steel-EN-GJL-300': {'POISSON': 0.3, 'YOUNGS': 125000.0}, 'Steel-EN-GJL-350': {'POISSON': 0.3, 'YOUNGS': 135000.0}, 'Steel-EN-GJMB-350-10': {'POISSON': 0.3, 'YOUNGS': 175000.0}, 'Steel-EN-GJMB-550-4': {'POISSON': 0.3, 'YOUNGS': 175000.0}, 'Steel-EN-GJMB-650-2': {'POISSON': 0.3, 'YOUNGS': 175000.0}, 'Steel-EN-GJMW-350-4': {'POISSON': 0.3, 'YOUNGS': 175000.0}, 'Steel-EN-GJMW-360-12': {'POISSON': 0.3, 'YOUNGS': 175000.0}, 'Steel-EN-GJMW-400-5': {'POISSON': 0.3, 'YOUNGS': 175000.0}, 'Steel-EN-GJMW-450-7': {'POISSON': 0.3, 'YOUNGS': 175000.0}, 'Steel-EN-GJS-400-15': {'POISSON': 0.3, 'YOUNGS': 167000.0}, 'Steel-EN-GJS-500-7': {'POISSON': 0.3, 'YOUNGS': 170000.0}, 'Steel-EN-GJS-600-3': {'POISSON': 0.3, 'YOUNGS': 177000.0}, 'Steel-EN-GJS-700-2': {'POISSON': 0.3, 'YOUNGS': 180000.0}, 'Steel-EN-GJS-800-1': {'POISSON': 0.3, 'YOUNGS': 180000.0}, 'Steel-G16Mn5': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-G200': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-G20Mn5': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-G230': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-G260': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-G300': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-G30Mn5': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-Generic': {'POISSON': 0.3, 'YOUNGS': 200000.0}, 'Steel-S185': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S235JO': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S235JR': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S235JRG1': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S260NC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S275JO': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S275JR': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S275N': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S335JO': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S335JR': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S335N': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S340MC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S355J2G3': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S380MC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S420MC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S420N': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S460MC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S460N': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S500MC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S550MC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-S690MC': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-St-37-2K': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-St-E-255': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-St-E-315': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-St-E-380': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-St-E-460': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-St-E-500': {'POISSON': 0.3, 'YOUNGS': 210000.0}, 'Steel-X2CrNiMoN17-13-3': {'POISSON': 0.3, 'YOUNGS': 200000.0}, 'Steel-X2CrNiN24-4': {'POISSON': 0.3, 'YOUNGS': 200000.0}, 'Steel-X39CrMo17-1': {'POISSON': 0.3, 'YOUNGS': 213000.0}, 'Steel-X3CrNiMo13-14': {'POISSON': 0.3, 'YOUNGS': 216000.0}, 'Steel-X5CrNi18-10': {'POISSON': 0.3, 'YOUNGS': 200000.0}, 'Steel-X5CrNiMo17-12-2': {'POISSON': 0.3, 'YOUNGS': 180000.0}, 'Steel-X6CrNiTi18-10': {'POISSON': 0.3, 'YOUNGS': 200000.0}, 'Wood-Generic': {'POISSON': 0.05, 'YOUNGS': 12000.0}}
-
- -
- -
-
-processor.BuildIgJg3DP1VF(me, nq)
-
- -
-
-processor.BuildIkVec(me, nq)
-
- -
-
-processor.ComputeGradientVecTr(q, me)
-
- -
-
-processor.ElemStiffElasMatBa3DP1Vec(nme, q, me, volumes, la, mu)
-
-

Computes all the element elastic stiffness matrices \(\mathbb{K}^e(T_k)\) for :math:`kin{0,hdots,

-
-
-
me-1}`

in local alternate basis.

-
-
param nme
-

number of mesh elements,

-
-
type nme
-

int

-
-
param q
-

mesh vertices,

-
-
type q
-

(3,nq) numpy array of floats

-
-
param me
-

mesh connectivity,

-
-
type me
-

(4,nme) numpy array of integers

-
-
param volumes
-

volumes of all the mesh elements.

-
-
type volumes
-

(nme,) numpy array of floats

-
-
param la
-

the \(\lambda\) Lame parameter,

-
-
type la
-

float

-
-
param mu
-

the \(\mu\) Lame parameter.

-
-
type mu
-

float

-
-
returns
-

a (144*nme,) numpy array of floats.

-
-
-
-
-
- -
-
-

Properties

-
-
-class properties.AntonPropertyGroup
-

Bases: bpy.types.PropertyGroup

-

Base class for dynamically defined sets of properties that are acessed -from :class: Anton_PT_Panel and used by all the operator classes.

-
-
Attributes:

initialized (BoolProperty): A boolean property to check if the problem has been initialzed. -forced (BoolProperty): A boolean property to check if all the forces acting on the model has been defined. -force_directioned (BoolProperty): A boolean property to check if directions for all the specified forces has been defined. -defined (BoolProperty): A boolean property to check if the problem has been defined. -filename (StringProperty): A string property that stores the active object’s name.

-
-
workspace_path (StringProperty): A string property that points at the workspace path

in which temporary variables are created/stored. Defaults to /tmp/

-
-
mode (EnumProperty): A enum property that defines the design space. Choose Shape to use existing geometry as is

for the design space definition or choose HULL to form a geometry around the existing objects. Existing objects are considered -as obstacles and are not included in the design space definition. Defaults to Shape.

-
-
-

number_of_forces (IntProperty): An integer property that defines the number of forces acting on the model.

-
-
-
-
-cl_max: None
-
- -
-
-defined: None
-
- -
-
-density_change: None
-
- -
-
-density_filter: None
-
- -
-
-emin: None
-
- -
-
-filename: None
-
- -
-
-force_directioned: None
-
- -
-
-forced: None
-
- -
-
-include_fixed: None
-
- -
-
-include_forced: None
-
- -
-
-initialized: None
-
- -
-
-keyframes: None
-
- -
-
-material: None
-
- -
-
-metaballrad: None
-
- -
-
-metaballsens: None
-
- -
-
-mode: None
-
- -
-
-number_of_forces: None
-
- -
-
-number_of_iterations: None
-
- -
-
-number_of_neighbours: None
-
- -
-
-penalty_exponent: None
-
- -
-
-rmin: None
-
- -
-
-sensitivity_filter: None
-
- -
-
-slices: None
-
- -
-
-viz_iteration: None
-
- -
-
-volumina_ratio: None
-
- -
-
-workspace_path: None
-
- -
- -
-
-class properties.ForcePropertyGroup
-

Bases: bpy.types.PropertyGroup

-
-
-magnitude: None
-
- -
- -
-
-

Visualizer

-
-
-class visualizer.Anton_OT_Visualizer
-

Bases: bpy.types.Operator

-
-
-static batches(x, n)
-
- -
-
-bl_description: str = 'Visualize results.'
-
- -
-
-bl_idname: str = 'anton.visualize'
-
- -
-
-bl_label: str = 'Anton_Visualizer'
-
- -
-
-execute(context)
-

Execute the operator

-
-
Parameters
-

context ('Context') –

-
-
Return type
-

typing.Union[typing.Set[str], typing.Set[int]]

-
-
Returns
-

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

-
-
-
- -
- -
-
- - -
- -
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 9599973..cf87891 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -37,117 +37,34 @@

Index

A - | B | C | D | E | F - | G | I - | K | M - | N | P - | R - | S | V - | W

A

- -
- -

B

- -
@@ -155,19 +72,7 @@

B

C

-
@@ -175,57 +80,33 @@

C

D

-

E

@@ -234,35 +115,7 @@

E

F

- -
- -

G

- - -
@@ -270,143 +123,59 @@

G

I

-
-

K

- - -
-

M

-

N

- - - -
-

P

-

R

- - -
- -

S

- - - -
-

V

- -
- -

W

- -
@@ -455,8 +210,8 @@

Navigation

diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html index 1ed895d..bd0e549 100644 --- a/docs/_build/html/index.html +++ b/docs/_build/html/index.html @@ -61,8 +61,8 @@

Navigation

diff --git a/docs/_build/html/installation.html b/docs/_build/html/installation.html index b531a76..f99a436 100644 --- a/docs/_build/html/installation.html +++ b/docs/_build/html/installation.html @@ -16,7 +16,7 @@ - + @@ -58,8 +58,8 @@

Navigation

@@ -69,7 +69,7 @@

Related Topics

diff --git a/docs/_build/html/introduction.html b/docs/_build/html/introduction.html index 45251cc..e49281c 100644 --- a/docs/_build/html/introduction.html +++ b/docs/_build/html/introduction.html @@ -58,8 +58,8 @@

Navigation

diff --git a/docs/_build/html/license.html b/docs/_build/html/license.html index b003946..8cc9ac4 100644 --- a/docs/_build/html/license.html +++ b/docs/_build/html/license.html @@ -57,8 +57,8 @@

Navigation

diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv index 2428264..737ef59 100644 Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html index fc3ee4a..e4b26ce 100644 --- a/docs/_build/html/py-modindex.html +++ b/docs/_build/html/py-modindex.html @@ -56,7 +56,7 @@

Python Module Index

- definer + definer   @@ -64,7 +64,7 @@

Python Module Index

- initializer + initializer   @@ -72,22 +72,12 @@

Python Module Index

- panel + processor - preferences - - - - - processor - - - - - properties + properties   @@ -95,7 +85,7 @@

Python Module Index

- visualizer + visualizer @@ -119,8 +109,8 @@

Navigation

diff --git a/docs/_build/html/interface.html b/docs/_build/html/quickstart.html similarity index 85% rename from docs/_build/html/interface.html rename to docs/_build/html/quickstart.html index ac9c2a1..591687f 100644 --- a/docs/_build/html/interface.html +++ b/docs/_build/html/quickstart.html @@ -5,7 +5,7 @@ - Interface — anton documentation + Quickstart — anton documentation @@ -16,7 +16,7 @@ - + @@ -34,8 +34,8 @@
-
-

Interface

+
+

Quickstart

@@ -58,8 +58,8 @@

Navigation

@@ -69,7 +69,7 @@

Related Topics

@@ -103,7 +103,7 @@

Quick search

& Alabaster 0.7.12 | - Page source
diff --git a/docs/_build/html/release.html b/docs/_build/html/release.html index faa1ad3..e90f163 100644 --- a/docs/_build/html/release.html +++ b/docs/_build/html/release.html @@ -17,7 +17,7 @@ - + @@ -58,8 +58,8 @@

Navigation

@@ -68,7 +68,7 @@

Navigation

Related Topics

diff --git a/docs/_build/html/scripts.html b/docs/_build/html/scripts.html new file mode 100644 index 0000000..42683c8 --- /dev/null +++ b/docs/_build/html/scripts.html @@ -0,0 +1,398 @@ + + + + + + + + Scripts — anton documentation + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ +
+

Scripts

+
+

Properties

+
+
+class properties.AntonPropertyGroup
+

Bases: bpy.types.PropertyGroup

+

A class for dynamically defined sets of properties that are acessed +from Anton_PT_Panel and used by all the operator classes.

+
+
Variables
+
    +
  • initialized (bool) –

  • +
  • forced (bool) –

  • +
  • force_directioned (bool) –

  • +
  • defined (bool) –

  • +
  • filename (str) –

  • +
  • workspace_path (str) –

  • +
  • mode (enum) –

  • +
  • number_of_forces (int) –

  • +
  • include_fixed (bool) –

  • +
  • include_forced (bool) –

  • +
  • density_filter (bool) –

  • +
  • sensitivity_filter (bool) –

  • +
  • cl_max (float) –

  • +
  • rmin (float) –

  • +
  • density_change (float) –

  • +
  • emin (float) –

  • +
  • metaballrad (float) –

  • +
  • metaballsens (float) –

  • +
  • volumina_ratio (float) –

  • +
  • penalty_exponent (float) –

  • +
  • number_of_iterations (int) –

  • +
  • viz_iteration (int) –

  • +
  • keyframes (int) –

  • +
  • slices (int) –

  • +
  • number_of_neighbours (int) –

  • +
  • material (enum) –

  • +
+
+
+
+ +
+
+class properties.ForcePropertyGroup
+

Bases: bpy.types.PropertyGroup

+

A class that holds magnitude of each applied force.

+
+
Variables
+

magnitude (float) –

+
+
+
+ +
+
+

Initializer

+
+
+class initializer.Anton_OT_ForceUpdater
+

Bases: bpy.types.Operator

+

Adds materials and vertex groups corresponding to the number +of forces acting on the model.

+
+
+execute(context)
+

Adds NATIVE, FIXED, NODESIGNSPACE and FORCE_{} materials and +vertex groups DIRECTION_{} to the active object.

+
+
Returns
+

FINISHED if successful, CANCELLED otherwise

+
+
+
+ +
+ +
+
+class initializer.Anton_OT_Initializer
+

Bases: bpy.types.Operator

+

Exports the mesh as .stl and imports it back so that each face is a triangle and their indices +match gmsh’s convention.

+
+
Returns
+

FINISHED if successful, CANCELLED otherwise

+
+
+
+
+execute(context)
+

Models can be initialized either as SHAPE or HULL. In the case of SHAPE, the existing geometry +is used for design space definition whereas HULL defines a design space with the existing objects as obstacles and +a scaled convexhull as design space boundary.

+
+
Variables
+
    +
  • bound_scale (float) –

  • +
  • objects (list) –

  • +
  • points (numpy.array) –

  • +
  • hull (numpy.array) –

  • +
+
+
Returns
+

FINISHED if successful, CANCELLED otherwise

+
+
+
+ +
+ +
+
+

Definer

+
+
+class definer.Anton_OT_Definer
+

Bases: bpy.types.Operator

+

An operator class that creates a tetrahedral finite element mesh of the model with gmsh_api, +interprets the forces acting on the model and stores the required variables as a numpy binary file (.npy).

+
+
+create_geo(path, filename, fixed_faces, no_design_faces, forced_faces, forced_magnitudes, forced_directions, forced_direction_signs, geo_points, geo_edges, points, edges, curve_loop, clmax)
+

Creates a tetrahedral finite element mesh of the model

+
+
Parameters
+
    +
  • path (str) –

  • +
  • filename (str) –

  • +
  • fixed_faces (set) –

  • +
  • no_design_faces (set) –

  • +
  • forced_faces (OrderedDict) –

  • +
  • forced_magnitudes (OrderedDict) –

  • +
  • forced_directions (OrderedDict) –

  • +
  • forced_direction_signs (OrderedDict) –

  • +
  • points (OrderedDict) –

  • +
  • edges (OrderedDict) –

  • +
  • curve_loop (OrderedDict) –

  • +
  • geo_points (OrderedDict) –

  • +
  • geo_edges (OrderedDict) –

  • +
  • clmax (float) –

  • +
+
+
Returns
+

nodes, elements, fixed_nodes, no_design_nodes, forced_nodes, directions, distributed_force

+
+
+
+ +
+
+execute(context)
+

Iterates through all the faces of the model and creates sets of face indices.

+
+
Variables
+
    +
  • nodes (numpy.array) –

  • +
  • elements (numpy.array) –

  • +
  • fixed_nodes (numpy.array) –

  • +
  • no_design_nodes (numpy.array) –

  • +
  • forced_nodes (numpy.array) –

  • +
  • directions (OrderedDict) –

  • +
  • distributed_force (OrderedDict) –

  • +
+
+
Returns
+

FINISHED if successful, CANCELLED otherwise

+
+
+
+ +
+ +
+
+class definer.Anton_OT_DirectionUpdater
+

Bases: bpy.types.Operator

+

Visualizes direction vector of applied force with grease pencil

+
+
+execute(context)
+

Instantiates an arrow at the centroid of a face on which force is applied. The instantiated arrow is +a grease pencil object whose color corresponds to the applied force.

+
+
Returns
+

FINISHED if successful, CANCELLED otherwise

+
+
+
+ +
+ +
+
+

Processor

+
+
+class processor.Anton_OT_Processor
+

Bases: bpy.types.Operator

+

Solves the optimization problem defined by nodes, elements, fixed, +no_design_nodes, youngs, poisson.

+
+
Returns
+

FINISHED if successful, CANCELLED otherwise

+
+
+
+
+execute(context)
+

Execute the operator

+
+
Parameters
+

context ('Context') –

+
+
Return type
+

typing.Union[typing.Set[str], typing.Set[int]]

+
+
Returns
+

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

+
+
+
+ +
+ +
+
+processor.ElemStiffElasMatBa3DP1Vec(nme, q, me, volumes, la, mu)
+

A function from pyOptFEM, developed at (C) University Paris XIII, Galilee Institute, LAGA, France. +pyOptFEM is a python software package for P_1-Lagrange Finite Element Methods in 3D. The project +maintained by F. Cuvelier, C. Japhet and G. Scarella.

+

For Online Documentation and Download we refer to http://www.math.univ-paris13.fr/~cuvelier

+

Computes all the element elastic stiffness matrices.

+
+
Parameters
+
    +
  • nme (int) – number of mesh elements,

  • +
  • q ((3,nq) numpy array of floats) – mesh vertices,

  • +
  • me ((4,nme) numpy array of integers) – mesh connectivity,

  • +
  • volumes ((nme,) numpy array of floats) – volumes of all the mesh elements.

  • +
  • la (float) – the \(\lambda\) Lame parameter,

  • +
  • mu (float) – the \(\mu\) Lame parameter.

  • +
+
+
Returns
+

a (nme, 144) numpy array of floats.

+
+
+
+ +
+
+

Visualizer

+
+
+class visualizer.Anton_OT_Visualizer
+

Bases: bpy.types.Operator

+
+
+execute(context)
+

Execute the operator

+
+
Parameters
+

context ('Context') –

+
+
Return type
+

typing.Union[typing.Set[str], typing.Set[int]]

+
+
Returns
+

result * RUNNING_MODAL Running Modal, Keep the operator running with blender. * CANCELLED Cancelled, The operator exited without doing anything, so no undo entry should be pushed. * FINISHED Finished, The operator exited after completing its action. * PASS_THROUGH Pass Through, Do nothing and pass the event on. * INTERFACE Interface, Handled but not executed (popup menus).

+
+
+
+ +
+ +
+
+ + +
+ +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html index a373295..60a1431 100644 --- a/docs/_build/html/search.html +++ b/docs/_build/html/search.html @@ -78,8 +78,8 @@

Navigation

diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 80423f9..a6bfac9 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["anton","index","installation","interface","introduction","license","release"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["anton.rst","index.rst","installation.rst","interface.rst","introduction.rst","license.rst","release.rst"],objects:{"":{definer:[0,0,0,"-"],initializer:[0,0,0,"-"],panel:[0,0,0,"-"],preferences:[0,0,0,"-"],processor:[0,0,0,"-"],properties:[0,0,0,"-"],visualizer:[0,0,0,"-"]},"definer.Anton_OT_Definer":{bl_description:[0,2,1,""],bl_idname:[0,2,1,""],bl_label:[0,2,1,""],compute_area:[0,3,1,""],compute_direction:[0,3,1,""],create_geo:[0,3,1,""],execute:[0,3,1,""],get_curve_loop:[0,3,1,""],get_edge_indices:[0,3,1,""],get_raw_data:[0,3,1,""]},"definer.Anton_OT_DirectionUpdater":{bl_idname:[0,2,1,""],bl_label:[0,2,1,""],direction_reverse:[0,2,1,""],execute:[0,3,1,""],force_id:[0,2,1,""]},"initializer.Anton_OT_ForceUpdater":{bl_idname:[0,2,1,""],bl_label:[0,2,1,""],diffuse_library:[0,2,1,""],execute:[0,3,1,""]},"initializer.Anton_OT_Initializer":{bl_description:[0,2,1,""],bl_idname:[0,2,1,""],bl_label:[0,2,1,""],execute:[0,3,1,""]},"panel.Anton_PT_Panel":{bl_category:[0,2,1,""],bl_idname:[0,2,1,""],bl_label:[0,2,1,""],bl_region_type:[0,2,1,""],bl_space_type:[0,2,1,""],draw:[0,3,1,""]},"preferences.AntonInstaller":{bl_description:[0,2,1,""],bl_idname:[0,2,1,""],bl_label:[0,2,1,""],execute:[0,3,1,""]},"preferences.AntonPreferences":{bl_idname:[0,2,1,""],draw:[0,3,1,""]},"processor.Anton_OT_Processor":{bl_description:[0,2,1,""],bl_idname:[0,2,1,""],bl_label:[0,2,1,""],compute_Dmat:[0,3,1,""],execute:[0,3,1,""],material_library:[0,2,1,""]},"properties.AntonPropertyGroup":{cl_max:[0,2,1,""],defined:[0,2,1,""],density_change:[0,2,1,""],density_filter:[0,2,1,""],emin:[0,2,1,""],filename:[0,2,1,""],force_directioned:[0,2,1,""],forced:[0,2,1,""],include_fixed:[0,2,1,""],include_forced:[0,2,1,""],initialized:[0,2,1,""],keyframes:[0,2,1,""],material:[0,2,1,""],metaballrad:[0,2,1,""],metaballsens:[0,2,1,""],mode:[0,2,1,""],number_of_forces:[0,2,1,""],number_of_iterations:[0,2,1,""],number_of_neighbours:[0,2,1,""],penalty_exponent:[0,2,1,""],rmin:[0,2,1,""],sensitivity_filter:[0,2,1,""],slices:[0,2,1,""],viz_iteration:[0,2,1,""],volumina_ratio:[0,2,1,""],workspace_path:[0,2,1,""]},"properties.ForcePropertyGroup":{magnitude:[0,2,1,""]},"visualizer.Anton_OT_Visualizer":{batches:[0,3,1,""],bl_description:[0,2,1,""],bl_idname:[0,2,1,""],bl_label:[0,2,1,""],execute:[0,3,1,""]},definer:{Anton_OT_Definer:[0,1,1,""],Anton_OT_DirectionUpdater:[0,1,1,""],draw_arrow:[0,4,1,""],get_grease_pencil:[0,4,1,""],get_grease_pencil_layer:[0,4,1,""],init_grease_pencil:[0,4,1,""]},initializer:{Anton_OT_ForceUpdater:[0,1,1,""],Anton_OT_Initializer:[0,1,1,""]},panel:{Anton_PT_Panel:[0,1,1,""]},preferences:{AntonInstaller:[0,1,1,""],AntonPreferences:[0,1,1,""]},processor:{Anton_OT_Processor:[0,1,1,""],BuildIgJg3DP1VF:[0,4,1,""],BuildIkVec:[0,4,1,""],ComputeGradientVecTr:[0,4,1,""],ElemStiffElasMatBa3DP1Vec:[0,4,1,""]},properties:{AntonPropertyGroup:[0,1,1,""],ForcePropertyGroup:[0,1,1,""]},visualizer:{Anton_OT_Visualizer:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","method","Python method"],"4":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:method","4":"py:function"},terms:{"050980392156862744":0,"100":0,"105000":0,"115000":0,"12000":0,"125000":0,"135000":0,"144":0,"1470":0,"150":0,"15crni6":0,"167000":0,"170000":0,"175000":0,"177000":0,"17crnimo6":0,"180000":0,"1c22":0,"1c35":0,"1c45":0,"1c60":0,"200":0,"200000":0,"20nicrmo2":0,"210000":0,"213000":0,"216000":0,"2300":0,"250":0,"255":0,"2550":0,"2800":0,"28mn6":0,"2930":0,"2c10":0,"300":0,"30crnimo8":0,"315":0,"3150":0,"32000":0,"3254901960784314":0,"34509803921568627":0,"34crnimo6":0,"350":0,"360":0,"3640":0,"36crnimo4":0,"36nicrmo16":0,"380":0,"3c15":0,"3c22":0,"3c35":0,"3v45":0,"400":0,"450":0,"45098039215686275":0,"460":0,"500":0,"5254901960784314":0,"5450980392156862":0,"550":0,"5529411764705883":0,"564":0,"5803921568627451":0,"5mg1f35":0,"600":0,"6061":0,"650":0,"69000":0,"6980392156862745":0,"700":0,"70000":0,"72000":0,"7803921568627451":0,"800":0,"8509803921568627":0,"8549019607843137":0,"88000":0,"9215686274509803":0,"95000":0,"9725490196078431":0,"boolean":0,"class":0,"default":0,"enum":0,"float":0,"int":0,"return":0,"static":0,"true":0,ABS:0,GJS:0,The:0,acess:0,acryl:0,act:0,action:0,activ:0,addonprefer:0,after:0,all:0,almg3f24:0,almgsi1f31:0,altern:0,aluminum:0,alzn4:0,annotation_lay:0,anton:0,anton_defin:0,anton_initi:0,anton_ot_defin:0,anton_ot_directionupdat:0,anton_ot_forceupdat:0,anton_ot_initi:0,anton_ot_processor:0,anton_ot_visu:0,anton_processor:0,anton_pt_panel:0,anton_visu:0,antoninstal:0,antonprefer:0,antonpropertygroup:0,anyth:0,around:0,arrai:0,attribut:0,b500:0,base:0,basi:0,batch:0,been:0,bl_categori:0,bl_descript:0,bl_idnam:0,bl_label:0,bl_region_typ:0,bl_space_typ:0,blender:[0,1],bool:0,boolproperti:0,bpy:0,buildigjg3dp1vf:0,buildikvec:0,built:1,c10:0,c15:0,c22e:0,c25e:0,c30e:0,c35_45:0,c40e:0,c50e:0,c55e:0,c60e:0,calculix:0,cancel:0,check:0,choos:0,cl_max:0,clear_lay:0,clmax:0,complet:0,comput:0,compute_area:0,compute_direct:0,compute_dmat:0,computegradientvectr:0,concret:0,connect:0,consid:0,context:0,creat:0,create_geo:0,creation:1,curve_loop:0,definit:0,density_chang:0,density_filt:0,design:[0,1],diffuse_librari:0,direct:0,direction_revers:0,directionupd:0,doing:0,draw:0,draw_arrow:0,dynam:0,e295:0,e335:0,e360:0,edg:0,elast:0,element:0,elemstiffelasmatba3dp1vec:0,emin:0,entri:0,enumproperti:0,event:0,execut:0,exist:0,exit:0,fals:0,fib:0,filenam:0,finish:0,fix:0,fixed_fac:0,forc:0,force_direct:0,force_id:0,forced_direct:0,forced_direction_sign:0,forced_fac:0,forced_magnitud:0,forcepropertygroup:0,forceupd:0,form:0,framework:1,from:0,g16mn5:0,g200:0,g20mn5:0,g230:0,g260:0,g300:0,g30mn5:0,gener:[0,1],geo_edg:0,geo_point:0,geometri:0,get_curve_loop:0,get_edge_indic:0,get_grease_pencil:0,get_grease_pencil_lay:0,get_raw_data:0,gjl:0,gjmb:0,gjmw:0,glass:0,gp_frame:0,gp_layer:0,gpencil:0,gpencil_layer_nam:0,gpencil_obj_nam:0,gpencillay:0,greasepencil:0,group:0,handl:0,has:0,hdot:0,hull:0,includ:0,include_fix:0,include_forc:0,init_grease_pencil:0,initialz:0,instal:0,integ:0,interfac:0,intproperti:0,its:0,keep:0,keyfram:0,kin:0,lambda:0,lame:0,layout:0,local:0,magnitud:0,make:0,materi:0,material_librari:0,math:0,mathbb:0,matric:0,menu:0,mesh:0,metaballrad:0,metaballsen:0,modal:0,mode:0,model:0,modul:0,name:0,nme:0,no_design_fac:0,none:0,norm:0,noth:0,number:0,number_of_forc:0,number_of_iter:0,number_of_neighbour:0,numpi:0,object:0,obstacl:0,open:1,oper:0,optim:0,pa6:0,param:0,paramet:0,pass:0,pass_through:0,path:0,penalty_expon:0,pet:0,pla:0,point:0,poisson:0,popup:0,problem:0,process:0,propertygroup:0,ptfe:0,push:0,pvc:0,reinforc:0,requir:0,result:0,revers:0,rmin:0,run:0,running_mod:0,s185:0,s235jo:0,s235jr:0,s235jrg1:0,s260nc:0,s275jo:0,s275jr:0,s275n:0,s335jo:0,s335jr:0,s335n:0,s340mc:0,s355j2g3:0,s380mc:0,s420mc:0,s420n:0,s460mc:0,s460n:0,s500mc:0,s550mc:0,s690mc:0,sensitivity_filt:0,set:0,shape:0,should:0,size:0,slice:0,sourc:1,space:0,specifi:0,start:0,steel:0,stiff:0,store:0,str:0,string:0,stringproperti:0,suit:1,surf:0,t_k:0,temporari:0,through:0,tmp:0,tupl:0,type:0,undo:0,union:0,use:0,used:0,variabl:0,vertex:0,vertic:0,view_3d:0,viz_iter:0,volum:0,volumina_ratio:0,which:0,without:0,wood:0,workspac:0,workspace_path:0,x2crnimon17:0,x2crnin24:0,x39crmo17:0,x3crnimo13:0,x5crni18:0,x5crnimo17:0,x6crniti18:0,young:0},titles:["Scripts","Welcome to anton\u2019s documentation!","Installation","Interface","Introduction","License","Releases"],titleterms:{anton:1,defin:0,document:1,initi:0,instal:2,interfac:3,introduct:4,licens:5,panel:0,prefer:0,processor:0,properti:0,releas:6,script:0,visual:0,welcom:1}}) \ No newline at end of file +Search.setIndex({docnames:["index","installation","introduction","license","quickstart","release","scripts"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst","installation.rst","introduction.rst","license.rst","quickstart.rst","release.rst","scripts.rst"],objects:{"":{definer:[6,0,0,"-"],initializer:[6,0,0,"-"],processor:[6,0,0,"-"],properties:[6,0,0,"-"],visualizer:[6,0,0,"-"]},"definer.Anton_OT_Definer":{create_geo:[6,2,1,""],execute:[6,2,1,""]},"definer.Anton_OT_DirectionUpdater":{execute:[6,2,1,""]},"initializer.Anton_OT_ForceUpdater":{execute:[6,2,1,""]},"initializer.Anton_OT_Initializer":{execute:[6,2,1,""]},"processor.Anton_OT_Processor":{execute:[6,2,1,""]},"visualizer.Anton_OT_Visualizer":{execute:[6,2,1,""]},definer:{Anton_OT_Definer:[6,1,1,""],Anton_OT_DirectionUpdater:[6,1,1,""]},initializer:{Anton_OT_ForceUpdater:[6,1,1,""],Anton_OT_Initializer:[6,1,1,""]},processor:{Anton_OT_Processor:[6,1,1,""],ElemStiffElasMatBa3DP1Vec:[6,3,1,""]},properties:{AntonPropertyGroup:[6,1,1,""],ForcePropertyGroup:[6,1,1,""]},visualizer:{Anton_OT_Visualizer:[6,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function"},terms:{"144":6,"case":6,"class":6,"enum":6,"export":6,"float":6,"function":6,"import":6,"int":6,"return":6,For:6,The:6,acess:6,act:6,action:6,activ:6,add:6,after:6,all:6,anton_ot_defin:6,anton_ot_directionupdat:6,anton_ot_forceupdat:6,anton_ot_initi:6,anton_ot_processor:6,anton_ot_visu:6,anton_pt_panel:6,antonpropertygroup:6,anyth:6,appli:6,arrai:6,arrow:6,back:6,base:6,binari:6,blender:[0,6],bool:6,bound_scal:6,boundari:6,bpy:6,built:0,can:6,cancel:6,centroid:6,cl_max:6,clmax:6,color:6,complet:6,comput:6,connect:6,context:6,convent:6,convexhul:6,correspond:6,creat:6,create_geo:6,creation:0,curve_loop:6,cuveli:6,definit:6,density_chang:6,density_filt:6,design:[0,6],develop:6,direct:6,direction_:6,distributed_forc:6,document:6,doing:6,download:6,dynam:6,each:6,edg:6,either:6,elast:6,element:6,elemstiffelasmatba3dp1vec:6,emin:6,entri:6,event:6,execut:6,exist:6,exit:6,face:6,file:6,filenam:6,finish:6,finit:6,fix:6,fixed_fac:6,fixed_nod:6,forc:6,force_:6,force_direct:6,forced_direct:6,forced_direction_sign:6,forced_fac:6,forced_magnitud:6,forced_nod:6,forcepropertygroup:6,framework:0,franc:6,from:6,galile:6,gener:0,geo_edg:6,geo_point:6,geometri:6,gmsh:6,gmsh_api:6,greas:6,group:6,handl:6,hold:6,http:6,hull:6,include_fix:6,include_forc:6,indic:6,instanti:6,institut:6,integ:6,interfac:6,interpret:6,iter:6,its:6,japhet:6,keep:6,keyfram:6,laga:6,lagrang:6,lambda:6,lame:6,list:6,magnitud:6,maintain:6,match:6,materi:6,math:6,matric:6,menu:6,mesh:6,metaballrad:6,metaballsen:6,method:6,modal:6,mode:6,model:6,nativ:6,nme:6,no_design_fac:6,no_design_nod:6,node:6,nodesignspac:6,noth:6,npy:6,number:6,number_of_forc:6,number_of_iter:6,number_of_neighbour:6,numpi:6,object:6,obstacl:6,onlin:6,open:0,oper:6,optim:6,ordereddict:6,otherwis:6,p_1:6,packag:6,paramet:6,pari:6,paris13:6,pass:6,pass_through:6,path:6,penalty_expon:6,pencil:6,point:6,poisson:6,popup:6,problem:6,project:6,propertygroup:6,push:6,pyoptfem:6,python:6,refer:6,requir:6,result:6,rmin:6,run:6,running_mod:6,scale:6,scarella:6,sensitivity_filt:6,set:6,shape:6,should:6,slice:6,softwar:6,solv:6,sourc:0,space:6,stiff:6,stl:6,store:6,str:6,success:6,suit:0,tetrahedr:6,through:6,triangl:6,type:6,undo:6,union:6,univ:6,univers:6,used:6,variabl:6,vector:6,vertex:6,vertic:6,viz_iter:6,volum:6,volumina_ratio:6,wherea:6,which:6,whose:6,without:6,workspace_path:6,www:6,xiii:6,young:6},titles:["Welcome to anton\u2019s documentation!","Installation","Introduction","License","Quickstart","Releases","Scripts"],titleterms:{anton:0,defin:6,document:0,initi:6,instal:1,introduct:2,licens:3,processor:6,properti:6,quickstart:4,releas:5,script:6,visual:6,welcom:0}}) \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index e6327a8..6fe25a5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,8 +17,8 @@ anton is a generative design framework built on Blender, the open-source 3D crea introduction installation - interface - anton + quickstart + scripts release license diff --git a/docs/interface.rst b/docs/interface.rst deleted file mode 100644 index 914293a..0000000 --- a/docs/interface.rst +++ /dev/null @@ -1,2 +0,0 @@ -Interface -========= \ No newline at end of file diff --git a/docs/quickstart.rst b/docs/quickstart.rst new file mode 100644 index 0000000..e397aa5 --- /dev/null +++ b/docs/quickstart.rst @@ -0,0 +1,2 @@ +Quickstart +========== \ No newline at end of file diff --git a/docs/_build/html/_sources/anton.rst.txt b/docs/scripts.rst similarity index 61% rename from docs/_build/html/_sources/anton.rst.txt rename to docs/scripts.rst index 4380a9a..bb839aa 100644 --- a/docs/_build/html/_sources/anton.rst.txt +++ b/docs/scripts.rst @@ -1,59 +1,42 @@ Scripts ======= -Definer --------------------- +Properties +----------------------- -.. automodule:: definer +.. automodule:: properties :members: - :undoc-members: :show-inheritance: + Initializer ------------------------ .. automodule:: initializer :members: - :undoc-members: :show-inheritance: -Panel ------------------- -.. automodule:: panel - :members: - :undoc-members: - :show-inheritance: - -Preferences ------------------------- +Definer +-------------------- -.. automodule:: preferences +.. automodule:: definer :members: - :undoc-members: :show-inheritance: + Processor ---------------------- .. automodule:: processor :members: - :undoc-members: :show-inheritance: -Properties ------------------------ - -.. automodule:: properties - :members: - :undoc-members: - :show-inheritance: Visualizer ----------------------- .. automodule:: visualizer :members: - :undoc-members: :show-inheritance: diff --git a/initializer.py b/initializer.py index f199e48..37fe335 100644 --- a/initializer.py +++ b/initializer.py @@ -4,6 +4,9 @@ from scipy.spatial import ConvexHull class Anton_OT_ForceUpdater(bpy.types.Operator): + """Adds materials and vertex groups corresponding to the number + of forces acting on the model. + """ bl_idname = "anton.forceupdate" bl_label = "" @@ -21,6 +24,11 @@ class Anton_OT_ForceUpdater(bpy.types.Operator): (255/255, 139/255, 0/255, 1)] def execute(self, context): + """Adds ``NATIVE``, ``FIXED``, ``NODESIGNSPACE`` and ``FORCE_{}`` materials and + vertex groups ``DIRECTION_{}`` to the active object. + + :return: ``FINISHED`` if successful, ``CANCELLED`` otherwise + """ scene = context.scene active_object = bpy.context.active_object @@ -42,7 +50,7 @@ def execute(self, context): for i in range(scene.anton.number_of_forces): if str('FORCE_{}'.format(i+1)) not in bpy.data.materials: - #TAKE CARE OF POPPING EXCESS FORCES + # Take care of popping of excess forces size = len(scene.forceprop) new = scene.forceprop.add() new.name = str(size+1) @@ -64,11 +72,31 @@ def execute(self, context): return{'CANCELLED'} class Anton_OT_Initializer(bpy.types.Operator): + """Exports the mesh as .stl and imports it back so that each face is a triangle and their indices + match gmsh's convention. + + :return: ``FINISHED`` if successful, ``CANCELLED`` otherwise + """ bl_idname = 'anton.initialize' bl_label = 'Anton_Initializer' bl_description = 'Makes fixed materials and force vertex groups.' def execute(self, context): + """Models can be initialized either as `SHAPE` or `HULL`. In the case of `SHAPE`, the existing geometry + is used for design space definition whereas `HULL` defines a design space with the existing objects as obstacles and + a scaled convexhull as design space boundary. + + :ivar bound_scale: + :vartype bound_scale: float + :ivar objects: + :vartype objects: list + :ivar points: + :vartype points: numpy.array + :ivar hull: + :vartype hull: numpy.array + + :return: ``FINISHED`` if successful, ``CANCELLED`` otherwise + """ scene = context.scene active_object = bpy.context.active_object bpy.context.space_data.shading.type = 'MATERIAL' diff --git a/processor.py b/processor.py index 5eeab0f..2517e73 100644 --- a/processor.py +++ b/processor.py @@ -71,8 +71,13 @@ def ComputeGradientVecTr(q,me): def ElemStiffElasMatBa3DP1Vec(nme,q,me,volumes,la,mu): """ - Computes all the element elastic stiffness matrices :math:`\mathbb{K}^e(T_k)` for :math:`k\in\{0,\hdots,\nme-1\}` - in local *alternate* basis. + A function from pyOptFEM, developed at (C) University Paris XIII, Galilee Institute, LAGA, France. + pyOptFEM is a python software package for P_1-Lagrange Finite Element Methods in 3D. The project + maintained by **F. Cuvelier**, **C. Japhet** and **G. Scarella**. + + For Online Documentation and Download we refer to http://www.math.univ-paris13.fr/~cuvelier + + Computes all the element elastic stiffness matrices. :param nme: number of mesh elements, :type nme: int @@ -86,7 +91,7 @@ def ElemStiffElasMatBa3DP1Vec(nme,q,me,volumes,la,mu): :type la: float :param mu: the :math:`\\mu` Lame parameter. :type mu: float - :returns: a ``(144*nme,)`` *numpy* array of floats. + :returns: a ``(nme, 144)`` *numpy* array of floats. """ ndf2=144; G=ComputeGradientVecTr(q,me) @@ -297,6 +302,11 @@ def ElemStiffElasMatBa3DP1Vec(nme,q,me,volumes,la,mu): ################################################## class Anton_OT_Processor(bpy.types.Operator): + """Solves the optimization problem defined by ``nodes``, ``elements``, ``fixed``, + ``no_design_nodes``, ``youngs``, ``poisson``. + + :return: ``FINISHED`` if successful, ``CANCELLED`` otherwise + """ bl_idname = 'anton.process' bl_label = 'Anton_Processor' bl_description = 'Start Optimization' diff --git a/properties.py b/properties.py index cb4adb8..eadf22b 100644 --- a/properties.py +++ b/properties.py @@ -2,6 +2,11 @@ from bpy.props import StringProperty, IntProperty, FloatProperty, EnumProperty, BoolProperty class ForcePropertyGroup(bpy.types.PropertyGroup): + """A class that holds magnitude of each applied force. + + :ivar magnitude: + :vartype magnitude: float + """ magnitude : FloatProperty( name="N", @@ -12,23 +17,67 @@ class ForcePropertyGroup(bpy.types.PropertyGroup): class AntonPropertyGroup(bpy.types.PropertyGroup): - """Base class for dynamically defined sets of properties that are acessed - from :class: `Anton_PT_Panel` and used by all the operator classes. - - Attributes: - initialized (BoolProperty): A boolean property to check if the problem has been initialzed. - forced (BoolProperty): A boolean property to check if all the forces acting on the model has been defined. - force_directioned (BoolProperty): A boolean property to check if directions for all the specified forces has been defined. - defined (BoolProperty): A boolean property to check if the problem has been defined. - filename (StringProperty): A string property that stores the active object's name. - - workspace_path (StringProperty): A string property that points at the workspace path - in which temporary variables are created/stored. Defaults to /tmp/ - mode (EnumProperty): A enum property that defines the design space. Choose `Shape` to use existing geometry as is - for the design space definition or choose `HULL` to form a geometry around the existing objects. Existing objects are considered - as obstacles and are not included in the design space definition. Defaults to `Shape`. - - number_of_forces (IntProperty): An integer property that defines the number of forces acting on the model. + """A class for dynamically defined sets of properties that are acessed + from **Anton_PT_Panel** and used by all the operator classes. + + :ivar initialized: + :vartype initialized: bool + :ivar forced: + :vartype forced: bool + :ivar force_directioned: + :vartype force_directioned: bool + :ivar defined: + :vartype defined: bool + + :ivar filename: + :vartype filename: str + :ivar workspace_path: + :vartype workspace_path: str + :ivar mode: + :vartype mode: enum + :ivar number_of_forces: + :vartype number_of_forces: int + + :ivar include_fixed: + :vartype include_fixed: bool + :ivar include_forced: + :vartype include_forced: bool + :ivar density_filter: + :vartype density_filter: bool + :ivar sensitivity_filter: + :vartype sensitivity_filter: bool + + :ivar cl_max: + :vartype cl_max: float + :ivar rmin: + :vartype rmin: float + :ivar density_change: + :vartype density_change: float + :ivar emin: + :vartype emin: float + + :ivar metaballrad: + :vartype metaballrad: float + :ivar metaballsens: + :vartype metaballsens: float + :ivar volumina_ratio: + :vartype volumina_ratio: float + :ivar penalty_exponent: + :vartype penalty_exponent: float + + :ivar number_of_iterations: + :vartype number_of_iterations: int + :ivar viz_iteration: + :vartype viz_iteration: int + :ivar keyframes: + :vartype keyframes: int + :ivar slices: + :vartype slices: int + :ivar number_of_neighbours: + :vartype number_of_neighbours: int + + :ivar material: + :vartype material: enum """ initialized : BoolProperty(default=False)