Skip to content

Commit

Permalink
Moved imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
senthurayyappan committed Aug 31, 2020
1 parent 9f053f6 commit aee3d7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions definer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from collections import OrderedDict
import bpy
import numpy as np
import gmsh_api.gmsh as gmsh
import os

def get_grease_pencil(gpencil_obj_name='GPencil') -> bpy.types.GreasePencil:
Expand Down Expand Up @@ -203,6 +202,8 @@ def execute(self, context):
\\
"""
import gmsh_api.gmsh as gmsh

scene = context.scene
active_object = bpy.data.objects[scene.anton.filename]

Expand Down Expand Up @@ -374,7 +375,7 @@ def create_geo(self,
clmax):

"""Creates a tetrahedral finite element mesh of the object with **gmsh_api**, adds physical groups for fixed, forced and non-design space faces
and retrieves direction of each applied force from assigned vertex groups.
and retrieves direction of each applied force from assigned vertex groups.
:param path: Workspace path
:type path: ``str``
Expand All @@ -389,7 +390,7 @@ def create_geo(self,
:type forced_faces: ``dict``
:param forced_magnitudes: Magnitude of each force
:type forced_magnitudes: ``dict``
:param forced_directions: Direction of each force
:type forced_directions: ``dict``
:param forced_direction_signs: Direction sign of each force
Expand All @@ -409,6 +410,8 @@ def create_geo(self,
:return: ``nodes``, ``elements``, ``fixed_nodes``, ``non_design_nodes``, ``forced_nodes``, ``directions``, ``distributed_force``
"""

import gmsh_api.gmsh as gmsh

geo = gmsh.model.geo
lc = clmax

Expand Down Expand Up @@ -540,7 +543,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)
Expand Down
2 changes: 1 addition & 1 deletion initializer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import bpy
import numpy as np
import os
from scipy.spatial import ConvexHull

class Anton_OT_ForceUpdater(bpy.types.Operator):
bl_idname = "anton.forceupdate"
Expand Down Expand Up @@ -96,6 +95,7 @@ def execute(self, context):
if not scene.anton.defined:
if scene.anton.mode == 'HULL':

from scipy.spatial import ConvexHull
objects = list()
points = list()

Expand Down

0 comments on commit aee3d7c

Please sign in to comment.