Giter Club home page Giter Club logo

Comments (4)

fangq avatar fangq commented on August 21, 2024

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.

from iso2mesh.

praveenvenky avatar praveenvenky commented on August 21, 2024

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;

from iso2mesh.

fangq avatar fangq commented on August 21, 2024

@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.

from iso2mesh.

praveenvenky avatar praveenvenky commented on August 21, 2024

from iso2mesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.