Rank: 918 based on 75 downloads (last 30 days) and 8 files submitted
photo

Mehmet OZTURK

E-mail
Company/University
Karadeniz Technical University
Lat/Long
40.99269485473633, 39.77565002441406

Personal Profile:

Electronics Engineering

Professional Interests:
Biomedical Image Processing

 

Watch this Author's files

 

Files Posted by Mehmet View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Jul 2011 Screenshot intersectPlaneSurf II Intersection of a plane with an arbitrary surface Author: Mehmet OZTURK intersection, plane, surface, triangle 15 1
  • 5.0
5.0 | 1 rating
19 Jul 2011 Screenshot IntersectPlaneTriangle mex Calculation of intersection between a plane and a triangle Author: Mehmet OZTURK intersection, plane, triangle, mex 5 0
07 Jul 2011 Screenshot DISTANCE2LINE c++ mex Orthogonal euclidean distances of points to a line with c++ mex Author: Mehmet OZTURK orthogonal euclidean ..., line, mex 1 1
05 Oct 2009 Screenshot intersectPlaneSurf Intersection points of an arbitrary surface with an arbitrary plane. Author: Mehmet OZTURK plane, intersection, contour, vector 8 9
  • 4.33333
4.3 | 3 ratings
10 Dec 2008 Screenshot myfrenet Construct tangent, normal and binormal vectors of a curve Author: Mehmet OZTURK tangent, normal, binormal, frenet, curve, points 12 0
  • 1.0
1.0 | 1 rating
Comments and Ratings by Mehmet View all
Updated File Comments Rating
05 Aug 2011 DISTANCE2LINE c++ mex Orthogonal euclidean distances of points to a line with c++ mex Author: Mehmet OZTURK

MATLAB's Lcc compiler could give some errors on compilation. I have used Microsoft Visual Studio Express Edition 2010

18 Jul 2011 intersectPlaneSurf Intersection points of an arbitrary surface with an arbitrary plane. Author: Mehmet OZTURK

Sorry, you can find necessary function from

http://people.sc.fsu.edu/~jburkardt/m_src/geometry/geometry.html

18 Jul 2011 intersectPlaneSurf Intersection points of an arbitrary surface with an arbitrary plane. Author: Mehmet OZTURK

Hi Ben, I think the following code solves your problem...

clear,clc

load intSurfPlane;

x = InstMesh.Vertices(1,:)';
y = InstMesh.Vertices(2,:)';
z = InstMesh.Vertices(3,:)';

p0=[0 0 0]; v=[1 0 0];

% plane=createPlane(p0,v); % createPlane from geom3d toolbox
[ A, B, C, D ] = plane_normal2imp_3d ( p0, v ); % create implicit plane function
segment_start=nan(3,round(size(InstMesh.Faces,2)/2));
segment_finish=segment_start;
count=1;
for s=1:size(InstMesh.Faces,2)
    t(:,1)=InstMesh.Vertices(:,InstMesh.Faces(1,s));
    t(:,2)=InstMesh.Vertices(:,InstMesh.Faces(2,s));
    t(:,3)=InstMesh.Vertices(:,InstMesh.Faces(3,s));
    [ num_int, pi ] = plane_imp_triangle_int_3d ( A, B, C, D, t );
    if num_int==2
        segment_start(:,count)=pi(:,1);
        segment_finish(:,count)=pi(:,2);
        count=count+1;
% hold on,plot3(pi(1,:),pi(2,:),pi(3,:))
    end
end
segment_start(:,all(isnan(segment_start),1))=[]; % remove unused poritons
segment_finish(:,all(isnan(segment_finish),1))=[]; % remove unused poritons

thr=2; nol=1;
while ~isempty(segment_start)
    lin{nol}=[segment_start(:,1) segment_finish(:,1)];
    segment_start(:,1)=[];
    segment_finish(:,1)=[];
    while 1
        testDistStart1=sum((lin{nol}(1,end)-segment_start(1,:)).^2 + ...
                    (lin{nol}(2,end)-segment_start(2,:)).^2 + ...
                    (lin{nol}(3,end)-segment_start(3,:)).^2,1);
       testDistStart2=sum((lin{nol}(1,end)-segment_finish(1,:)).^2 + ...
                    (lin{nol}(2,end)-segment_finish(2,:)).^2 + ...
                    (lin{nol}(3,end)-segment_finish(3,:)).^2,1);
        [minDist1, best_ind1]=min(testDistStart1);
        [minDist2, best_ind2]=min(testDistStart2);
        if minDist1<thr || minDist2<thr
            if minDist1<minDist2
                lin{nol}=[lin{nol} segment_finish(:,best_ind1)];
                segment_start(:,best_ind1)=[];
                segment_finish(:,best_ind1)=[];
            else
                lin{nol}=[lin{nol} segment_start(:,best_ind2)];
                segment_start(:,best_ind2)=[];
                segment_finish(:,best_ind2)=[];
            end
        else
            nol=nol+1;
            break
        end
    end
end

s = trisurf(InstMesh.Faces', x, y, z, 'EdgeColor', 'none', 'FaceColor', 'interp');
daspect([1 1 1]);
for m=1:size(lin)
    hold on,plot3(lin{m}(1,:),lin{m}(2,:),lin{m}(3,:))
end
hold off

16 Mar 2010 intersectPlaneSurf Intersection points of an arbitrary surface with an arbitrary plane. Author: Mehmet OZTURK

"myfrenet.m".
http://www.mathworks.com/matlabcentral/fileexchange/22376-myfrenet

01 Sep 2009 Fancy splash screen for compiled .exe GUIs Displays your splash screen while loading your compiled GUI Author: W Thielicke
Comments and Ratings on Mehmet's Files View all
Updated File Comment by Comments Rating
26 Oct 2011 MYUNIQUE finds uniqe entries, indices and number of occurances of the unique elements Author: Mehmet OZTURK Farrahi Moghaddam, Reza
05 Aug 2011 DISTANCE2LINE c++ mex Orthogonal euclidean distances of points to a line with c++ mex Author: Mehmet OZTURK OZTURK, Mehmet

MATLAB's Lcc compiler could give some errors on compilation. I have used Microsoft Visual Studio Express Edition 2010

19 Jul 2011 intersectPlaneSurf II Intersection of a plane with an arbitrary surface Author: Mehmet OZTURK Ben

Nice function, thanks!

19 Jul 2011 intersectPlaneSurf Intersection points of an arbitrary surface with an arbitrary plane. Author: Mehmet OZTURK Ben

Hi Mehmet,

Thanks a lot for your code! But I got error message at the line

  if minDist1<thr || minDist2<thr

The error message is

??? Operands to the || and && operators must be convertible to
logical scalar values.

This is due to that the minDist1 and minDist2 are empty. Did you meet that?

Best,
Ben

18 Jul 2011 intersectPlaneSurf Intersection points of an arbitrary surface with an arbitrary plane. Author: Mehmet OZTURK OZTURK, Mehmet

Sorry, you can find necessary function from

http://people.sc.fsu.edu/~jburkardt/m_src/geometry/geometry.html

Top Tags Applied by Mehmet
intersection, mex, approximation, interpolation, plane
Files Tagged by Mehmet View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Jul 2011 Screenshot intersectPlaneSurf II Intersection of a plane with an arbitrary surface Author: Mehmet OZTURK intersection, plane, surface, triangle 15 1
  • 5.0
5.0 | 1 rating
19 Jul 2011 Screenshot IntersectPlaneTriangle mex Calculation of intersection between a plane and a triangle Author: Mehmet OZTURK intersection, plane, triangle, mex 5 0
07 Jul 2011 Screenshot DISTANCE2LINE c++ mex Orthogonal euclidean distances of points to a line with c++ mex Author: Mehmet OZTURK orthogonal euclidean ..., line, mex 1 1
05 Oct 2009 Screenshot intersectPlaneSurf Intersection points of an arbitrary surface with an arbitrary plane. Author: Mehmet OZTURK plane, intersection, contour, vector 8 9
  • 4.33333
4.3 | 3 ratings
10 Dec 2008 Screenshot myfrenet Construct tangent, normal and binormal vectors of a curve Author: Mehmet OZTURK tangent, normal, binormal, frenet, curve, points 12 0
  • 1.0
1.0 | 1 rating

Contact us at files@mathworks.com