Costa's minimal surface

Next
 From:  bemfarmer
7673.1 
Not having javascript code for a Weierstrass function: :-)

Data for a Costa minimal surface for PovRay were downloaded from here:
https://github.com/andrejbauer/costa-surface
After much effort and learning, the .csv file was converted to an .obj file.
The file costa-object.inc, a simple PovRay include file with vertices and triangle corner indices,
proved to be convenient to use with Excel and Notepad++,
to convert it first to a comma delimited .csv file, and then to a simple .obj file.

Using Notepad++, the ">," were Replaced with "blank".
Also, the "blank <" were converted first to "<," for use in Excel as a .csv,
Excel was then used to remove some decimals,(unnecessary?), and more importantly, increment
the face indices numbers by 1, as PovRay uses zero indexing face numbers,
whereas .obj apparently uses indexing starting at "1".
In the excel Developer tab, an excel macro was used to do the +1 to all of the face indices..
The Excel command button code, using cells G1:G10 for testing is:

Private Sub CommandButton1_Click()
On Error Resume Next
Set C = Range("G1:G10").Cells.SpecialCells(xlCellTypeConstants)
For Each cc In C
cc.Value = cc.Value + 1
Next
End Sub

The macro command button was explained here:
http://www.excel-easy.com/vba/create-a-macro.html
The increment macro was a variation with (face indices) cells B1:B3408, C1:C3408, and D1:C3408, from here:
http://www.mrexcel.com/forum/excel-questions/468109-macro-increment-cell-value-one.html

(To save the working file, the Excel macro command button file has to be saved in macro enabled xlsm file.)
(Very puzzling at the time, note that when ImportObj script encountered a 0 face index, it quit at 6 faces, also, Obj23dm.exe did better, but produced ~30% incorrect triangles with the 0 indexing.)
This strange behavior was corrected by adding +1 to the indices.
The vertex normals were discarded, but could have been converted also. Later Moi can export an .obj with vertex normals.

After deleting the command button, and saving file as .csv, Notepad++ was then used again.
The exponential notations such as 3.12E-14 were replaced by 0 (probably unneccesary?),
using Replace with Checkbox Regular Expressions selected, with the search
(\d\.\d\d)E-14 replaced with "0" (Similarly for E-15, E-16, and E-17.)
The "<," were replaced by either "v " for the vertices, or "f " for the faces.
(vertex normals would have been "vn " if they had been included.) (note space(s))
The csv delimiter "," were replaced by " ". (note space)
The .csv file is now renamed to .obj. It is a barebones .obj, with vertex x,y,z list,
and also face indice triplets, indicating the vertex of each triangle.
Michaels obj23dm.exe can be used on th .obj now, or the new script of Max Smirnov,

ImportObj can be used to get the .obj into Moi as a .3dm. This file is ~10mb.
SubdivBeta9 can be run on the .3dm, for a file of ~14mb. There is still some "creasing."
Rendering was done on both the re-exported Moi .3dm, and the subdivBeta9 .3dm, in KeyShot5.

- Brian


EDITED: 17 Oct 2015 by BEMFARMER


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7673.2 In reply to 7673.1 
The prior image used a Moi object export from the subdivBeta9 costa.
This image is Moi object export of the original costa surface.
Default Moi obj saves were done in both cases.

- Brian


EDITED: 18 Mar by BEMFARMER

Image Attachments:
Size: 73.4 KB, Downloaded: 1 time, Dimensions: 160x160px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  futagoza (STEFAN)
7673.3 
Great work Brian!

Thank you also for providing the model! :-) I hope you don't mind that i reworked your triangle mesh a bit to get a smooth surface. Maybe you can render this too, or thicken it and 3d print it.. ;-)

Best regards
Stefan




EDITED: 4 Nov 2016 by STEFAN

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7673.4 In reply to 7673.3 
Thanks Stefan,
Your mesh is much better.
I imported to Moi, joined, and ran subdivbeta9.
It took awhile, but ended up at 117,116 kb
Exported obj at 8.37 degrees, quads and triangles, was 182,273 kb, and looked superb in keyshot5.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  futagoza (STEFAN)
7673.5 In reply to 7673.4 
You`re welcome, Brian!

What i did with your mesh was to make from the long small triangles big ones and then i applied a LS3 Loop subdivision in Meshlab, to obtain a smooth surface. Here's one derived mesh from yours, after modifying it, and with Dual remeshing applied.

Regards
Stefan


EDITED: 19 Oct 2015 by STEFAN

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7673.6 
Elegant!
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  futagoza (STEFAN)
7673.7 
Thank you Pilou!

Regards
Stefan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  futagoza (STEFAN)
7673.8 
Hi Brian,

just a small update... I wanted to make a NURBS surface and noodled a lot with some solutions, which were not satisfactory, until i downloaded today a Trial of ZBRush... I think i need to buy me a copy of ZBrush in the future due to it's fantastic ZRemesher, for example. Simply amazing, imho. After that i converted with Fusion360 T-Splines.

I attach the files, both quad mesh and NURBS model.

Best regards
Stefan


EDITED: 4 Nov 2016 by STEFAN


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7673.9 In reply to 7673.8 
Thank you Stefan for the excellent information.
I think I will try for a Nurbs Costa surface script this winter, LOL.
Gang or Elliptic may have Weierstrass code.
There is also the L. Baker book with some old C code...
I'm not sure how the math works.
There are also higher Genus Costa surfaces, with 2+ holes.

- Brian

EDITED: 25 Oct 2015 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  futagoza (STEFAN)
7673.10 
Hi Brian,

a script would be interesting. Wish i could program. Would help me often in some scenarios.

Regards
Stefan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All