1
0
mirror of git://projects.qi-hardware.com/ben-scans.git synced 2024-11-25 00:08:26 +02:00
Commit Graph

54 Commits

Author SHA1 Message Date
Werner Almesberger
2cc9a9e505 Step sizes are now auto-determined, allowing use of files of any resolution.
- solidify/face.h (struct face): record the x, y, and z step sizes
- solidify/face.c (load_file, read_file): moved file I/O from read_file to
  load_file
- solidify/face.c (adjust_step, read_file): before populating the array,
  determine the x/y and z step sizes
- solidify/solidify.c (main): verify that both faces have the same step
  sizes
- solidify/solidify.c (main): don't use hard-coded z step size
- solidify/solidify.c (main): move call to setlocale() next to gtk_init(),
  to make it clear whose damage we're trying to control
2010-09-24 19:53:06 -03:00
Werner Almesberger
0c494069c3 The #endif at end of header file must have a comment saying /* !name */
- solidify/array.h, solidify/histo.h, solidify/level.h, solidify/solid.h,
  solidify/util.h" comment at final #endif said /* name */, not /* !name */
2010-09-24 18:58:55 -03:00
Werner Almesberger
a7105addcb Like rotations, shifts can now be accelerated by changing the mouse position.
- solidify/overlap.c (do_shift, shift): instead of passing an integer
  direction, pass a floating-point distance
- solidify/overlap.c (scroll_event): weight shifts as well. Closer to the
  circle means faster.
- solidify/style.h (DIST_STEPS): acceleration factor for shifts
2010-09-24 18:24:10 -03:00
Werner Almesberger
9c614db35a Bottom face was flipped in overlap.
- solidify/overlap.c (draw_map): flip x-axis of bottom face (and remove
  comment suggesting to flip the y axis. The x-axis is better, since this
  is often how things are scanned.)
2010-09-24 18:16:10 -03:00
Werner Almesberger
d4a5575599 Some simple optimizations increase drawing speed in overlap by 33%.
- solidify/overlap.c (overlap): added speed testing loop
- solidify/overlap.c (zmix): instead of floor/ceil, we just use
  floor/floor+1. With the ramp() change below, an 18% speed increase results
- solidify/overlap.c (ramp): after the above change, w0 and w1 can never be
  zero, so we don't have to test for this case
- solidify/array.h (get_bounded), solidify/array.c: inline get_bounded(),
  yielding a 13% speed increase
2010-09-24 17:56:55 -03:00
Werner Almesberger
2764155d15 Increase dynamic range of rotation and follow "far from center = faster"
paradigm.

- solidify/overlap.c (scroll_event): make weighting of rotation exponential,
  so we can both adjust precisely and spin rapidly. Also reverse weighting
  to rotate more quickly on the outside.
- solidify/style.h (SLOWEST_ROT, FASTEST_ROT): parameters for weighting of
  rotation
2010-09-24 17:28:48 -03:00
Werner Almesberger
0186959a12 solidify/main.pov: don't use weird "x is up" perspective 2010-09-24 16:54:53 -03:00
Werner Almesberger
7c24783cab More corrections to handling of the "user" matrix. Made controls more intuitive.
- solidify/overlap.c (rotate): don't reverse y shift either
- solidify/overlap.c (scroll_event): reverse rotation (since we've fixed
  the math of the coordinate transformation)
- solidify/overlap.c (scroll_event): reverse rotation if mouse is on the
  left side
- solidify/overlap.c (shift): reversing the direction in the "down"
  quadrant is systematic but quite confusing, so don't do it
2010-09-24 16:48:07 -03:00
Werner Almesberger
898970b3dd Instead of performing the tranformations stepwise for each point, pre-calculate
them once.

- solidify/matrix.h, solidify/matrix.c: 2D matrix operations
- solidify/Makefile (OBJS): added matrix.o
- solidify/face.h (struct matrix): moved to solidify/matrix.h
- solidify/overlap.c (point, merge_matrix, draw_map): precalculate a single
  vA+b transformation instead of stepwise transforming the vector inside
  the loop
- solidify/overlap.c (do_shift): now that the math is right (or at least
  better), reverse the shift
2010-09-24 16:42:36 -03:00
Werner Almesberger
37e840fa77 Infrastructure for generating POV-Ray output (not useful yet)
- solidify/Makefile: added solid.o
- solidify/solid.h, solidify.c (height_field, povray): output the part as
  the intersection of two height fields
- solidify/solidify.c (main): generate POV-Ray output if stdout is
  redirected
- solidify/Makefile (run, pov, disp): targets to run a test setup, render
  it, and display the result
- solidify/main.pov: simple scene showing the test part
2010-09-24 06:37:12 -03:00
Werner Almesberger
f3e7c1ec73 Various coordinate transform corrections in overlap.c
- solidify/face.h (struct matrix), solidify/face.c (read_file): also record
  the face's center
- solidify/overlap.c (point): reference faces to the screen center
- solidify/overlap.c (point): use correct model coordinates for z0
  calculation
2010-09-24 03:46:32 -03:00
Werner Almesberger
85855ec5ac Overlapping now has an OSD, too.
- solidify/overlap.c (BORDER, sx, sy), solidify/style.h (OVERLAP_BORDER):
  moved and renamed
- solidify/overlap.c (r_center, scroll_event): moved center radius
  calculation to separate function
- solidify/overlap.c (draw_image): renamed to draw_map
- solidify/overlap.c (draw_image): draw an on-screen display (OSD)
- solidify/level.c (expose_event, overlap): propagate OSD on/off switch
- solidify/overlap.c (osd_proximity, scroll_event, motion_notify_event,
  overlap): enable OSD when approaching the center circle or a diagonal
- solidify/overlap.c (scroll_event): reversed the direction of rotation
2010-09-24 02:54:04 -03:00
Werner Almesberger
edb12b6e95 When leveling, the center circle is now shown when the pointer approaches it.
- solidify/Makefile: added util.o
- solidify/util.h, solidify/util.c (draw_circle): wrapper for gdk_draw_arc
- solidify/Makefile: added style.o
- solidify/style.h, solidify/style.c, solidify/solidify.c (main): GUI style
  parameters and items
- solidify/level.c (scroll_z. scroll_xy, scroll_event, level),
  solidify/overlap.c (scroll_event, overlap): renamed "da" to "darea", to
  avoid confusion with "da" for GdkDrawable in style.c
- solidify/level.c (r_center, scroll_event): moved center radius
  calculation to separate function
- solidify/level.c (draw_image): renamed to draw_map
- solidify/level.c (draw_image): draw an on-screen display (OSD)
- solidify/level.c (scroll_z, scroll_xy, expose_event, level): propagate
  OSD on/off switch
- solidify/level.c (scroll_event, motion_notify_event, level): enable OSD
  when approaching the center circle
2010-09-24 02:04:04 -03:00
Werner Almesberger
d49f349fa0 The top face can now be shifted.
- solidify/overlap.c (scroll_event): use center of canvas as center, not
  center of the top face
- solidify/overlap.c (do_shift, shift, scroll_event): added translation
  (shifting)
2010-09-24 01:11:57 -03:00
Werner Almesberger
525e1557ec Use two faces and show how they overlap (in progress)
- solidify/face.h (face_z0): calculate height of z0 plane
- solidify/level.c (draw_image): use face_z0 instead of open-coding the
  calculation
- solidify/overlap.c (draw_image, point): moved per-point processing from
  draw_image() to point()
- solidify/overlap.c (point): show differences between both faces
- solidify/solidify.c (usage, main): load both faces
- solidify/solidify.c (usage, main): accept distance between faces as third
  argument
2010-09-24 00:43:56 -03:00
Werner Almesberger
1fa23c574e Introduce a solid data type and use it, mainly in overlap()
- solidify/solid.h: definition of a solid made from two opposing faces
- solidify/overlap.h (overlap), solidify/overlap.c (draw_image,
  scroll_event, overlap): operate on solid instead of face
- solidify/overlap.c (sx, sy, draw_image, overlap): helper functions sx()
  and sy() to determine canvas size
- solidify/overlap.c (BORDER, sx, sy): added a border around the piece,
  to help with positioning
- solidify/solidify.c (clicked, gui_buttons, gui, main): use solid instead
  of faces
2010-09-23 23:41:35 -03:00
Werner Almesberger
b8bba1d3ab The GUI can now switch among operations.
- solidify/level.c (key_press_event, make_screen), solidify/solidify.c
  (key_press_event): moved "q" handler to solidify.c
- solidify/level.h (level), solidify/level.c (make_screen, level): removed
  root window initialization and merged remainder into "level"
- solidify/overlap.h (overlap), solidify/overlap.c (make_screen, overlap):
  removed root window initialization and merged remainder into "overlap"
- solidify/solidify.c (gui): initialize the root window
- solidify/solidify.c (gui, gui_buttons, clicked): added buttons to select
  operation
2010-09-23 23:18:46 -03:00
Werner Almesberger
fbbbd29a28 Minor level.c cleanup.
- solidify/level.c (draw_map): remove, and use draw_image instead
- solidify/level.c (scroll_z): removed commented-out root->window
  initialization
2010-09-23 22:30:47 -03:00
Werner Almesberger
cef7cd5e18 Added interactive 2D transformation (working towards overlapping)
- solidify/Makefile (OBJS): added overlap.o
- solidify/Makefile (CFLAGS): added -O9 to speed up rotation a little
- solidify/array.h, solidify/array.c (get_bounded): like get(), but returns
  UNDEF if the indices are outside the array
- solidify/face.h (struct face, struct matrix), solidify/face.c (read_file):
  added a 2D transformation matrix to "struct face"
- solidify/overlap.h, solidify/overlap.c: show a face with 2D transformation
2010-09-23 22:17:19 -03:00
Werner Almesberger
598df91d9f Added copyright headers all over the place. (GPLv2+) 2010-09-23 20:13:48 -03:00
Werner Almesberger
8eed5e3ecb Makefile cleanup and instrumentation (verbosity, dependencies, etc.)
- solidify/Makefile: added verbosity control (default is silent, enable
  verbose output with V=1)
- solidify/Makefile: added "spotless" target
- solidify/Makefile (CFLAGS): moved warning options to CFLAGS_WARN
- solidify/Makefile: added dependency use and generation, with friendly
  permission from fped/Makefile
2010-09-23 20:05:25 -03:00
Werner Almesberger
06b1b08c47 Added red and green band to blue band as further visual clues.
- solidify/level.c (draw_map): moved open-coded "almost at the same height"
  parameter to constant NEAR
- solidify/level.c (draw_map): draw green and red band next to the "near"
  blue band
2010-09-23 19:55:11 -03:00
Werner Almesberger
77a2b2d8c6 ben-lcdframe-front is done at 1 mm and 500 um X/Y resolution. 2010-09-23 13:48:01 -03:00
Werner Almesberger
ca1e348731 ben-lcdframe-back-100um is done. 2010-09-23 08:19:16 -03:00
Werner Almesberger
b5a2d5d8ef Files can now be specified as HTTP/HTTPS URLs.
- solidify/face.c (read_face): moved code into new function read_file
- solidify/face.c (read_face): added wrapper for cached wget of http: and
  https: URLs
2010-09-23 07:22:05 -03:00
Werner Almesberger
6ac06aab7c Control inclination of the z0 plane. (Needs more work.)
- solidify/face.h (struct face), solidify/face.c (read_face),
  solidify/level.c (draw_map, draw_image): introduce inclination of the z0
  plane
- solidify/level.c (draw_map): make blue z == z0 display more continuous
- solidify/level.c (scroll_event): moved z0 shift to scroll_z
- solidify/level.c (scroll_event, scroll_xy): added manipulation of the
  z0 plane's inclination
2010-09-22 19:20:29 -03:00
Werner Almesberger
ecf993e0f2 solidify: set the initial height to the median; uncompress .bz2 on the fly.
- solidify/Makefile, solidify/histo.h, solidify/histo.c: generate a Z
  histogram and find the median height
- solidify/face.c (read_face): set z_ref to the median, not the average
- solidify/face.c (read_face): uncompress .bz2 files on the fly
- solidify/face.c (read_face): don't close standard input (for style)
2010-09-22 17:40:03 -03:00
Werner Almesberger
5f84394774 solidify: fast interactive face to solid converter 2010-09-22 17:04:43 -03:00
Werner Almesberger
d5001c6c4a ben-lcdframe-back-500um is done. 2010-09-21 13:23:15 -03:00
Werner Almesberger
6186a7202e ben-lcdframe-back-1mm is done. 2010-09-21 06:23:21 -03:00
Werner Almesberger
2cf011dcfb ben-baseframe-bottom-100um is done. 2010-09-21 03:57:29 -03:00
Werner Almesberger
3b14f67b31 Put scans on index page in top-down order and added placeholders for still
pending scans.

- web/index.sh: put scans of individual parts in top-down order
- web/index.sh: added placeholders for scans still missing
- index.html: regenerated with changes above
2010-09-19 20:00:56 -03:00
Werner Almesberger
1fd036ec31 ben-baseframe-bottom-500um is done. 2010-09-19 09:54:31 -03:00
Werner Almesberger
b9747fb0a3 ben-baseframe-bottom-1mm is done. 2010-09-18 11:49:26 -03:00
Werner Almesberger
16fab72914 ben-baseframe-top-100um is done. 2010-09-18 09:55:00 -03:00
Werner Almesberger
c7468bda69 Scan main page is now http://downloads.qi-hardware.com/people/werner/ben-scans/
Assorted cleanup.

- web/Makefile: added index upload to downloads.qi-hardware.com
- web/index.sh, index.html: a <P> got abbreviated to just <
- data/jpg/ben-dispshell-inside-100um.jpg: image was a uncropped screenshot,
  oops !
2010-09-17 18:43:21 -03:00
Werner Almesberger
750e72098b ben-baseframe-top: 1 mm and 500 um scans. 2010-09-16 19:18:52 -03:00
Werner Almesberger
d6cbffc7cd ben-dispshell-inside, 500 um and 100 um are done. 2010-09-16 14:42:28 -03:00
Werner Almesberger
65644231a2 ben-dispshell-inside-1mm is done. 2010-08-31 04:31:39 -03:00
Werner Almesberger
1462d9d72f ben-dispshell-outside-100um is done. 2010-08-31 04:23:28 -03:00
Werner Almesberger
aedcb76633 ben-dispshell-outside: 1 mm and 500 um scans are done. 2010-08-29 11:00:08 -03:00
Werner Almesberger
a939369de4 ben-kbd-bottom-100um is not pretty but it's done. (Data files and Web index.) 2010-08-27 15:57:53 -03:00
Werner Almesberger
42f6a9966e Index page update for recent completions.
- web/Makefile: make test.html and index.html phony so that they're rebuilt
  each time we run make (make doesn't know all the dependencies)
- web/index.sh: added ben-bottom-nobat-100um
- web/index.sh: added ben-kbd-top-1mm and ben-kbd-top-500um
- web/index.sh: added complete ben-bottom-inside2 series
- web/index.sh: added pointer to ben-bottom-inside2 to ben-bottom-inside
- web/style.sh (scan_set): add name anchor for each series
2010-08-26 02:11:42 -03:00
Werner Almesberger
988d3f4b70 ben-kbd-bottom, 1mm and 500 um data. 2010-08-26 02:05:32 -03:00
Werner Almesberger
827c705233 ben-bottom-inside2-* data files. 2010-08-26 00:57:10 -03:00
Werner Almesberger
cd3a3b96fd ben-bottom-nobat-100um data files. 2010-08-26 00:34:35 -03:00
Werner Almesberger
32b314875a Index page update for ben-dispbase-back-100um completion.
- web/index.sh: ben-dispbase-back-100um has completed
- web/index.sh: ben-bottom-nobat-100um is running
- index.html: generated from latest index,sh
- bz: path generation was all wrong
2010-08-18 23:28:08 -03:00
Werner Almesberger
7d7fb57fb4 ben-dispbase-back-100um is done. Pushing data files ... 2010-08-18 23:05:12 -03:00
Werner Almesberger
a339d67968 Work around the problem of not being able to just put index.html into Qi, and
have the brower interpret it as HTML when browsing the repository through the
Web interface: generate a test.html by default, with local paths, and generate
the real index.html, with remote URLs, when uploading.

- web/style.sh: only set BASE if not set already in the environment
- web/Makefile: added test.html target and made it the default
- web/index.sh: ben-dispbase-back-100um is running now, switch to "in progress"
- web/index.sh: switched 100 um ben-bottom-nobat scan from "under
  consideration" to "planned". In fact, it's the next in line.
2010-08-04 22:23:57 -03:00
Werner Almesberger
0381184366 Removed obsolete partially done bottom scan. 2010-08-03 14:14:35 -03:00