Hi Laurent,
Indeed, if you could have your terrain surface as a topology in e.g. STEP format, you could then import it in Gmsh and use it to "slice" a box (using boolean operations through the OCC kernel). I have done it multiple times. A work-around is to do that with freecad (see e.g. the attached commands) and load the resulting STEP file in Gmsh.
Julien
On Wed, 20 Mar 2019 08:01:41, Christophe Geuzaine <[email protected]> wrote: Hi Laurent, It's doable, but since you would need to connect this discrete surface with new CAD surfaces to build a volume, it would be easier if the input mesh had a topology, i.e. if you provided the surface + the bounding curves + points for the 4 corners. Then new surfaces and a volume could be constructed, connected to these curves/points, and all the standard meshing algorithms could be used. Christophe

On 19 Mar 2019, at 21:54, Laurent BRICTEUX<[email protected]>  wrote:

Dear all,

Is it possible to obtain a volume mesh starting from an stl terrain surface 
(see attachment)?
I would like to make a CFD mesh consisting in a volume box for which the bottom 
surface is a prescribed terrain.
The elements should be tets only.
Is there any example geo file that could help to solve my problem ?

Thank you for your help and the nice piece of soft.

Laurent

<AskerveinHill.stl.zip>_______________________________________________
gmsh mailing list
[email protected]
http://onelab.info/mailman/listinfo/gmsh

?
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine


import FreeCAD
import Mesh
import Part
import Draft
import BOPTools.SplitFeatures
import ImportGui
doc = App.newDocument()
mesh = doc.addObject("Mesh::Feature","Mesh")
mesh.Mesh = Mesh.Mesh(u"AskerveinHill.stl")
surf = doc.addObject("Part::Feature","Surface")
shape = Part.Shape()
shape.makeShapeFromMesh(mesh.Mesh.Topology, 0.1)
surf.Shape = shape
box = doc.addObject("Part::Box","Box")
bb = mesh.Mesh.BoundBox
box.Length = bb.XMax - bb.XMin
box.Width  = bb.YMax - bb.YMin
box.Height = (bb.ZMax - bb.ZMin)*1.1
box.Placement = App.Placement(App.Vector(bb.XMin,bb.YMin,bb.ZMin),App.Rotation(App.Vector(0,0,1),0))
j = BOPTools.SplitFeatures.makeSlice(name= 'Slice')
j.Base = box
j.Tools = surf
j.Mode = 'Split'
j.Proxy.execute(j)
j.purgeTouched()
for obj in j.ViewObject.Proxy.claimChildren():
    obj.ViewObject.hide()
Draft.downgrade(doc.Slice, delete=True)
doc.recompute()
Draft.downgrade(doc.Compound, delete=True)
doc.recompute()
ImportGui.export([doc.Solid,doc.Solid001],u"AskerveinHill.step")
_______________________________________________
gmsh mailing list
[email protected]
http://onelab.info/mailman/listinfo/gmsh

Reply via email to