1
0
mirror of git://projects.qi-hardware.com/ben-scans.git synced 2024-11-28 07:49:42 +02:00
Commit Graph

70 Commits

Author SHA1 Message Date
Werner Almesberger
dbc736089e grr 2010-09-27 12:27:55 -03:00
Werner Almesberger
26beb8af0c Added "new" along with its paraphernalia.
- sfy/Makefile (new): added "new" target and the variables is uses (from
  cae-tools/solidify/Makefile)
2010-09-27 12:08:18 -03:00
Werner Almesberger
252da04019 ben-bottom-outside2-100um is done. 2010-09-27 11:59:23 -03:00
Werner Almesberger
3b6325d914 Show an exploded view of all parts scanned so far in one image.
- sfy/ben.pov: show a stack of all parts scanned so far
- sfy/Makefile: replaced $(NAME).inc with general .sfy -> .inc rule
- sfy/Makefile (PROJECTS): renamed to PARTS
- sfy/Makefile (ben): process ben.pov
2010-09-27 03:39:55 -03:00
Werner Almesberger
6e287cdfb6 Makefile and helper scripts for running solidify and POV-Ray.
- sfy/Makefile: shortcuts for common operations. Based on solidify/Makefile
- sfy/solidify: wrapper to invoke solidify over at cae-tools
- sfy/template.pov: standard scene template, from cae-tools/solidify
2010-09-27 02:46:54 -03:00
Werner Almesberger
c00799f3c9 Re-aligned all projects after fixing the inclination in solidify.
- sfy/*.sfy: inverted fx, tracking change in solidify
- sfy/*.sfy: re-aligned all projects after fixing the inclination. Massive
  amount of weirdness have vanished now.
- sfy/kbd.sfy: added the keyboard as well
2010-09-27 02:43:16 -03:00
Werner Almesberger
4226d0bca2 Experimental alignments for solidify. 2010-09-26 22:06:18 -03:00
Werner Almesberger
b45e536c37 ben-bottom-outside2 is done at 1 mm and 500 um resolution. 2010-09-25 10:39:41 -03:00
Werner Almesberger
bec698814e Moved solidify to a new and more suitable project: cae-tools.
http://projects.qi-hardware.com/index.php/p/cae-tools/

Keeping code in ben-scans wasn't such a good idea, because one has to
check out all the huge data files along with it too. Better keep to two
separate.
2010-09-25 04:50:18 -03:00
Werner Almesberger
f0a8bcd95e In POV-Ray output, move faces to more correct Z locations.
- solidify/povray.c: update title for renaming
- solidify/povray.c (povray_face, povray): flip the bottom face
- solidify/povray.c (povray_face, povray): instead of centering the face on
  Z, shift it to its z0 position
- solidify/povray.c (povray_face, povray): split the distance between faces
  equally among them
2010-09-25 04:40:08 -03:00
Werner Almesberger
f37441a7c2 ben-lcdframe-front-100um is done. 2010-09-25 04:07:25 -03:00
Werner Almesberger
49ea351443 All there is in solid.c is about POV-Ray, so rename it to povray.c
- solidify/solid.c: renamed to solidify/povray.c
- solidify/Makefile (OBJS): change solid.o to povray.o
2010-09-25 03:23:19 -03:00
Werner Almesberger
98b6050e83 Fix our trigonometry: the z0 inclination is expressed as a tangent, not a sine.
- solidify/project.c (read_face_data, save_face_data): fx/fy represent a
  tangent, not a sine
- solidify/overlap.c (merge_matrix): corrected shrinkage formula to use
  tangent instead of sine
2010-09-25 03:15:11 -03:00
Werner Almesberger
286a6bdd09 Sanitize POV-Ray output (in progress)
- solidify/main.pov: set up a more traditional view than POV-Ray's "camera"
  model
- solidify/main.pov: mark the coordinate axes with colored balls
- solidify/main.pov: make the part semi-transparent so that we can see the
  coordinate axes
- solidify/solid.c (povray_face, povray): moved dumping a face from
  povray() to povray_face()
- solidify/solid.c (povray_face): scale the height field to its real size
- solidify/solid.c (povray_face): rotate the face such that height is Z
- solidify/solid.c (povray_face): translate the face such that its center
  is at the origin
2010-09-25 02:44:59 -03:00
Werner Almesberger
01d8e411f3 Use the project name to disambiguate names in POV-Ray output.
- solidify/main.pov: change name from "Part" to "Part_batcvr"
- solidify/solid.h (povray), solidify/solid.c (sanitize, povray): use the
  project name as prefix for PGM files and a suffix for the object name
- solidify/solidify.c (main): pass the project's basename to povray()
2010-09-24 21:28:42 -03:00
Werner Almesberger
f6ed3bf762 solidify now stores the context of sessions in project description files.
- solidify/Makefile (OBJS): added project.o
- solidify/Makefile (new): new target to create a new project
- solidify/Makefile (run): changed to resume previously created project
- solidify/util.h (stralloc): added stralloc (from fped)
- solidify/project.h, solidify/project.c: create, load, and save project
  description files
- solidify/solidify.c (clicked, gui_buttons, gui, main): updated to use
  project instead of solid
- solidify/solidify.c (usage, main): new invocation: four arguments to start
  new project, one argument to resume old project
2010-09-24 21:01:59 -03:00
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