Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ofloveandhate/bertini_real
Browse files Browse the repository at this point in the history
… into develop
  • Loading branch information
ofloveandhate committed Apr 4, 2024
2 parents fdb0382 + b0d1778 commit e13136b
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 2 deletions.
4 changes: 2 additions & 2 deletions m4/ax_boost_timer.m4
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ AC_DEFUN([AX_BOOST_TIMER],
AC_CACHE_CHECK(whether the Boost::Timer library is available,
ax_cv_boost_timer,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/timer.hpp>
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/timer/timer.hpp>
]],
[[boost::timer r(); return 0;]])],
[[boost::timer::auto_cpu_timer r(); return 0;]])],
ax_cv_boost_timer=yes, ax_cv_boost_timer=no)
AC_LANG_POP([C++])
])
Expand Down
36 changes: 36 additions & 0 deletions python/example/plot_surface_colored_by_piece.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# an example of splitting an algebraic surface into pieces separated by singularities,
# and plotting each with a solid color

import bertini_real as br
import matplotlib.pyplot as plt

import pathlib

pkl_files = list(pathlib.Path('.').glob('*.pkl'))

if not pkl_files:
print('found no pickled data, so trying to gather_and_save')
br.data.gather_and_save()


decomposition = br.data.read_most_recent()
print(f'done reading data')


pieces = decomposition.separate_into_nonsingular_pieces()
print(f'separated into {len(pieces)} pieces')


# make a plotter object
plotter = br.plot.Plotter()

# set some options
plotter.options.render.vertices = False
plotter.options.render.surface_raw = False

plotter.options.style.colormap = plt.cm.viridis

# plot it!
plotter.plot(pieces)


29 changes: 29 additions & 0 deletions python/example/surface_separate_and_save_raw_and_smooth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import bertini_real as br
import matplotlib.pyplot as plt

import pathlib

pkl_files = list(pathlib.Path('.').glob('*.pkl'))

if not pkl_files:
print('found no pickled data, so trying to gather_and_save')
br.data.gather_and_save()



thickness = 0.01 # this is in object dimensions.

decomposition = br.data.read_most_recent()

print(f'done reading data')

pieces = decomposition.separate_into_nonsingular_pieces()
print(f'separated into {len(pieces)} pieces')





for p in pieces:
p.solidify_smooth(distance=thickness)
p.solidify_raw(distance=thickness)
15 changes: 15 additions & 0 deletions test/surface/dingdong/demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import bertini_real as br

surface = br.data.read_most_recent()

pieces = surface.separate_into_nonsingular_pieces()

surface.write_piece_data()

br.surface.copy_all_scad_files_here()

for p in pieces:
p.export_smooth()


br.plot.plot(pieces)
43 changes: 43 additions & 0 deletions test/surface/nordstrands_weird/assemble.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import bertini_real as br
import matplotlib.pyplot as plt
import dill
# br.data.gather_and_save()

surf = br.data.read_most_recent()

# fileObject = open('BRdata3.pkl', 'rb')
# surf = dill.load(fileObject)
# fileObject.close()

surf.write_piece_data()

pieces = surf.separate_into_nonsingular_pieces()


br.surface.copy_all_scad_files_here()
#
# plotter = br.plot.plot(pieces)

# plotter = br.plot.plot(pieces[0])

# surf.export_raw()
# surf.export_smooth()

for p in pieces:
# p.export_smooth()
p.solidify_smooth(0.02)

print(p.point_singularities() )
# p.solidify_raw(0.02)



plotter = br.plot.Plotter()
plotter.options.render.vertices = False
plotter.options.render.surface_raw = False

plotter.options.style.colormap = plt.cm.nipy_spectral

# plotter.plot(decomposition)
plotter.plot(pieces)

26 changes: 26 additions & 0 deletions test/surface/octdong/assemble.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import bertini_real as br
import matplotlib.pyplot as plt
import dill

def plot_pieces(pieces):
plotter = br.plot.Plotter()
plotter.options.render.vertices = False
plotter.options.render.surface_raw = False

plotter.options.style.colormap = plt.cm.nipy_spectral

plotter.plot(pieces)


br.data.gather_and_save()

surf = br.data.read_most_recent()
surf.write_piece_data()
pieces = surf.separate_into_nonsingular_pieces()
br.surface.copy_all_scad_files_here()

for p in pieces:
p.export_smooth()

plot_pieces(pieces)

0 comments on commit e13136b

Please sign in to comment.