2014-01-09 20:20:44 +06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import logging
|
|
|
|
from geomsmesh import geompy
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
# --- crée zone géométrique défaut a partir d'un filling
|
|
|
|
|
|
|
|
def creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion=50):
|
|
|
|
"""
|
|
|
|
Construction CAO de la zone à remailler, quand on utilise un filling,
|
2014-08-25 21:26:29 +06:00
|
|
|
après appel creeZoneDefautMaillage et quadranglesToShapeNoCorner
|
2014-01-09 20:20:44 +06:00
|
|
|
@param filling : la CAO de la peau du défaut reconstituée
|
|
|
|
@param shapeDefaut : objet géométrique représentant la fissure
|
|
|
|
(selon les cas, un point central, ou une shape plus complexe,
|
|
|
|
dont on ne garde que les vertices)
|
|
|
|
@return (facesDefaut = filling, centreDefaut, normalDefaut, extrusionDefaut)
|
|
|
|
"""
|
|
|
|
logging.info("start")
|
|
|
|
|
|
|
|
trace = True
|
|
|
|
facesDefaut = filling
|
|
|
|
centreSphere = geompy.MakeCDG(shapeDefaut)
|
|
|
|
geompy.addToStudy(centreSphere, "cdg_defaut")
|
|
|
|
centreDefaut = geompy.MakeProjection(centreSphere, filling)
|
|
|
|
if trace:
|
|
|
|
geompy.addToStudy(centreDefaut, "centreDefaut")
|
|
|
|
normalDefaut = geompy.GetNormal(filling, centreDefaut)
|
|
|
|
if trace:
|
|
|
|
geompy.addToStudy(normalDefaut, "normalDefaut")
|
|
|
|
extrusionDefaut = geompy.MakePrismVecH(filling, normalDefaut, -lgExtrusion)
|
|
|
|
if trace:
|
|
|
|
geompy.addToStudy(extrusionDefaut, "extrusionDefaut")
|
|
|
|
|
|
|
|
return facesDefaut, centreDefaut, normalDefaut, extrusionDefaut
|