On Thu, Sep 22, 2011 at 4:13 PM, c. <carlo.defa...@gmail.com> wrote:
> Juan Pablo,
>
> Sorry it took me so long for me to reply to your questions on GMSH functions,
> it's not due to lack of interest but to lack of time
>
> On 22 Sep 2011, at 15:55, Juan Pablo Carbajal wrote:
>
>> function for the msh package
>>  data2geo.m -- Takes a matrix descibing a polygon and generates a
>> file to mesh it.
>>  pointGeo.m -- Creates the Gmesh string that describes a point.
>>  lineGeo.m -- Creates the Gmesh string that describes a line.
>>  lineLoopGeo.m -- Creates the Gmesh string that describes a lineloop.
>>  planeSurfGeo.m -- Creates the Gmesh string that describes a planar Surface.
>>  ruledSurfGeo.m -- Creates the Gmesh string that describes a ruled Surface.
>>
>> new package: geometry
>>  Will add functions from matGeom.
>
> the functions for programmatically creating gmsh .geo files, in my opinion,
> are rather related to geometry than meshing, why don't you consider joining 
> them
> with the svg IO functions you submitted previosly and adding them all to the
> geometry package?
>
> It would be great to even have automatic SVG to geo conversion!
> one could then draw a geometry with his/her favourite drawing program and use
> it as input for msh ...
>
> c.

Dear Carlo,

Ok, I will do as you suggest.

If you draw an simple polygon in an SVG and save it as plain SVG (with
inkscape for example) you can do what you ask, though is still sloopy.
Assuming you saved the simple polygon in foo.svg

svg = svgload('foo.svg'); % loads the raw svg
svg = svgnormalize(svg); % Aspect ration of the polygon is maintained
but BB has unit diagonal.
P = svgpath2polygon(svg.path)

%% here apply all transformations on the polygon to get the right
size, position and orientation

geo = data2geo(P,0.01)

Creates a geo file ready to mesh with 0.01 edge size.

I just noticed that the formatting I am using is creating some
problems. But the code works (if you remove some spaces after the name
of functions)!


-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to