fangq / iso2mesh

Iso2Mesh - a 3D surface and volumetric mesh generator for MATLAB/Octave
http://iso2mesh.sf.net
Other
182 stars 73 forks source link

extrudesurf and s2m #35

Closed praveenvenky closed 5 years ago

praveenvenky commented 5 years ago

Hello, 1.I wanted to generate a counterpart(bottom part) for a toppart.

  1. So i used volface() and extracted all triangular faces.
  2. I extracted only the bottom surface of the top part with triangular mesh.
  3. I extruded it and used meshrepair(meshfix) and generated a solid using s2m with tetrahedral mesh.

My problem here is the number of nodes on the bottom surface of top part and top surface of bottom part are not same even though they are same. Please help me how to solve this.

best regards Praveen

fangq commented 5 years ago

hi @praveenvenky, it would be a lot easier for me to understand the problem if you can attach some sample images or script/data.

generally speaking, after meshcheckrepair, you will unlikely to get the same number of nodes/element because the repairing is performed independently on both the top/bottom surfaces.

praveenvenky commented 5 years ago

hi @fangq , please see the below script My problem is to get the bottom part with same number of nodes and elements as Top part. But without using meshcheckrepair i cannot get the result to s2m. Also, if I use meshcheckrepair, it gives different number of elements as you said. Is there a possibility for me to get same number of elements?

%% load('elements_TP.mat'); % elements of top part

load('nodes_TP.mat') % nodes of TP

%% Extract all the triangular faces of top part. [openface,elemid]=volface(elements_TP(:,2:5)); openface(:,4) = elemid; node=nodes_TP(:,2:4) % surfExt_Top(openface, node) %% Extracting the neg-Z surface of the top part % here I have used normals to take only the bottom elements and nodes of TP. % then I have to extrude it dowwnwards to get the bottom part. t=4.5; extrude_vector=[0 0 -t]; keepratio= 1; maxvol=15; ISO2MESH_TETGENOPT='-A -q1.1a' [Neg_zface,node,Neg_z_node_numbers,Neg_z_node_coords] = negZ_top(openface, nodes_TP(:,2:4));% node_coords=nodes_TP(:,2:4)

difference= Neg_z_node_numbers-find(Neg_z_node_numbers) triangularelements=Neg_zface; % these below 5 lines are just to get uniform numbering of node and not to bother much abt it for i=1:length(Neg_zface) triangularelements(i,1)=Neg_zface(i,1) - difference(Neg_z_node_numbers(:,1)==Neg_zface(i,1)); triangularelements(i,2)=Neg_zface(i,2) - difference(Neg_z_node_numbers(:,1)==Neg_zface(i,2)); triangularelements(i,3)=Neg_zface(i,3) - difference(Neg_z_node_numbers(:,1)==Neg_zface(i,3)); end plotmesh(Neg_z_node_coords,triangularelements) %% Giving offset value as a parametric value(for cohesive layer) offset= 0.3; Neg_z_node_coords(:,3)=Neg_z_node_coords(:,3)-offset;

%% [extrude_node,extrude_face] = extrudesurf(Neg_z_node_coords,triangularelements,extrude_vector); [extrude_node,extrude_elem]=meshcheckrepair(extrude_node,extrude_face,'meshfix'); plotmesh(extrude_node,extrude_elem) [bottom_part_nodes,bottom_part_elem,bottom_part_faces] = s2m(extrude_node,extrude_elem,keepratio,maxvol); plotmesh(bottom_part_nodes,bottom_part_elem)

node=bottom_part_nodes; elem=bottom_part_elem;

fangq commented 5 years ago

@praveenvenky, unfortunately meshcheckrepair (more specifically, meshfix) does not have the capability to correlate two surface patches.

the only way to do this is perhaps recreating the bottom (or top part) from the other part by projecting one to another (or projecting to a plane). It is going to be complicated.

praveenvenky commented 5 years ago

Dear Fang,You have suggested me to project top part on to plane to obtain a perfect bottom part for a top part(you can see your suggestion below). I don't want the whole part to be similar in mesh but only the interface surfaces i.e, top part's bottom surface and bottom-part's top surface must be similar. But after extrusion of top part's bottom surface and applying s2m why the initial number of nodes and elements before extrusion  is getting altered.Please suggest me some material if you know to solve this problem and get the similar number of elements and nodes on both surfaces.Best RegardsPraveen Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Qianqian Fang notifications@github.com Date: 04/10/2019 7:35 pm (GMT+01:00) To: fangq/iso2mesh iso2mesh@noreply.github.com Cc: praveenvenky p.sethumadhavan-vasan@tu-braunschweig.de, Mention mention@noreply.github.com Subject: Re: [fangq/iso2mesh] extrudesurf and s2m (#35) @praveenvenky, unfortunately meshcheckrepair (more specifically, meshfix) does not have the capability to correlate two surface patches. the only way to do this is perhaps recreating the bottom (or top part) from the other part by projecting one to another (or projecting to a plane). It is going to be complicated.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/fangq/iso2mesh/issues/35?email_source=notifications\u0026email_token=AM6LJY6KAF5IRUPRDZW3IILQM55HJA5CNFSM4IW2QRM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMLZBQ#issuecomment-538492038", "url": "https://github.com/fangq/iso2mesh/issues/35?email_source=notifications\u0026email_token=AM6LJY6KAF5IRUPRDZW3IILQM55HJA5CNFSM4IW2QRM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMLZBQ#issuecomment-538492038", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]