Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: jdf/patchy
base: 9169dcf55a
...
head fork: jdf/patchy
compare: 312d64b219
  • 3 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
4 .classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK 5"/>
- <classpathentry combineaccessrules="false" kind="src" path="/processing-head"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java 5"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
88 resources/build.xml → build.xml
@@ -1,12 +1,13 @@
-<project name="processingLibs" default="build" basedir="../">
+<project name="processingLibs" default="build">
<description>
Patchy build
</description>
- <property name="processing" location="c:/Documents and Settings/Administrator/Desktop/processing-1.0.1/libraries" />
+ <property name="processing" location="../processing-1.5.1" />
+ <property name="processingLibraries" location="C:/Documents and Settings/Administrator/My Documents/Processing/libraries" />
- <property name="libraryClasspath" location="${processing}/../lib" />
+ <property name="libraryClasspath" location="${processing}/lib" />
<path id="library-classpath">
<fileset dir="${libraryClasspath}">
<include name="core.jar" />
@@ -15,23 +16,20 @@
<property name="javaVersion" value="1.5" />
- <property name="author" value="Jonathan Feinberg" />
- <property name="copyright" value="(c) 2008" />
- <property name="libraryName" value="Patchy" />
- <property name="versionNumber" value="0.3.0" />
+ <property file="library.properties" prefix="library" />
+
+ <property name="author" value="Jonathan Feinberg" />
+ <property name="copyright" value="(c) 2011" />
+ <property name="libraryName" value="patchy" />
<property name="yourLink" value="http://mrfeinberg.com/" />
<property name="keywords" value="bicubic,patch,Bezier,Hermite,Catmull-Rom,BSpline,parametric surface" />
<property name="tested:platform" value="Windows" />
- <property name="tested:processingVersion" value="1.0.1" />
+ <property name="tested:processingVersion" value="1.5.1" />
<property name="tested:dependencies" value="" />
<property name="source:host" value="GitHub" />
<property name="source:url" value="http://github.com/jdf/patchy/" />
<property name="source:repository" value="http://github.com/jdf/patchy/" />
- <property name="cygwin" value="c:/cygwin/bin"/>
- <property name="chmod" value="${cygwin}/chmod.exe"/>
- <property name="rsync" value="${cygwin}/rsync.exe"/>
-
<!-- no changes or adjustments required below -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
@@ -39,20 +37,18 @@
<pathelement location="./resources/code/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
- <property name="jarFile" value="${libraryName}.jar" />
+ <property name="jarFile" value="patchy.jar" />
<property name="src" location="src" />
<property name="bin" location="bin" />
<property name="reference" location="reference" />
<property name="dist" location="distribution" />
-
-
<target name="init">
<echo>Properties initialized.
src path ${src}
bin path ${bin}
libraryClasspath ${libraryClasspath}
- processing Libraries ${processing}
+ processing Libraries ${processingLibraries}
java version ${javaVersion}
</echo>
<echo>building library ...</echo>
@@ -64,27 +60,27 @@
</target>
<target name="pushweb" depends="build">
- <exec executable="${chmod}" dir="distribution/web">
- <arg value="-R"/>
- <arg value="+rwX"/>
- <arg value="*"/>
+ <exec executable="sh" dir="distribution/web">
+ <arg value="-c"/>
+ <arg value="chmod -R +rwX *"/>
</exec>
- <exec executable="${rsync}" dir="distribution/web">
- <env key="PATH" value="${cygwin}"/>
- <arg value="-azv"/>
- <arg value="--exclude"/>
- <arg value=".svn/"/>
- <arg value="--delete"/>
- <arg value="-e"/>
- <arg value="ssh"/>
- <arg value="*"/>
- <arg value="mrfeinberg.com:/var/www/html/mrfeinberg.com/patchy"/>
+ <exec executable="sh" dir="distribution/web">
+ <arg value="-c"/>
+ <arg value="rsync -azv --exclude .svn --delete -e ssh * jdf@mrfeinberg.com:/var/www/html/mrfeinberg.com/patchy"/>
+ </exec>
+ <exec executable="sh" dir="distribution/web">
+ <arg value="-c"/>
+ <arg value="ssh jdf@mrfeinberg.com chmod -R a+rX /var/www/html/mrfeinberg.com/patchy"/>
</exec>
</target>
<!-- compile the library -->
<target name="compile" depends="init" description="compile the source">
- <javac destdir="${bin}" source="${javaVersion}">
+ <echo message="bin: ${bin}"/>
+ <echo message="javaVersion: ${javaVersion}"/>
+ <echo message="library-classpath$ ${library-classpath}"/>
+ <mkdir dir="${bin}"/>
+ <javac target="${javaVersion}" destdir="${bin}" source="${javaVersion}">
<classpath>
<path refid="library-classpath" />
</classpath>
@@ -108,6 +104,9 @@
<mkdir dir="${realDist}/reference" />
<mkdir dir="${realDist}/src" />
<jar jarfile="${realDist}/library/${jarFile}" basedir="${bin}" />
+
+ <copy todir="${realDist}" file="library.properties"/>
+
<copy todir="${realDist}/examples">
<fileset dir="examples" />
</copy>
@@ -131,14 +130,14 @@
</copy>
<!-- copy the jar file to processing's libraries -->
- <copy todir="${processing}">
+ <copy todir="${processingLibraries}">
<fileset dir="${dist}" />
</copy>
<!-- zip the distribution of the library -->
<zip destfile="${dist}/${libraryName}.zip" basedir="${dist}" excludes="**/_DS.Store,**/applet/**" />
- <rename src="${dist}/${libraryName}.zip" dest="${dist}/${libraryName}_${versionNumber}.zip" />
+ <copy file="${dist}/${libraryName}.zip" tofile="${dist}/${libraryName}_${library.version}.zip" />
<!-- organize the ${dist} folder -->
<mkdir dir="${dist}/web" />
@@ -156,27 +155,15 @@
<fileset dir="web" />
</copy>
- <!--
- format the index.html file.
- regular expressions are used to parse the web index.html file.
- key words starting and ending with ## are replaced by values
- defined earlier in the beginning of this build file.
- -->
+ <copy tofile="${dist}/web/patchy.txt" file="library.properties"/>
<replaceregexp file="${dist}/web/index.html" match="##yourLibrary##" replace="${libraryName}" flags="g" />
-
<replaceregexp file="${dist}/web/index.html" match="##author##" replace="${author}" flags="g" />
-
- <replaceregexp file="${dist}/web/index.html" match="##versionNumber##" replace="${versionNumber}" flags="g" />
-
+ <replaceregexp file="${dist}/web/index.html" match="##versionNumber##" replace="${library.version}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##yourLink##" replace="${yourLink}" flags="g" />
-
<replaceregexp file="${dist}/web/index.html" match="##date##" replace="${date}" flags="g" />
-
<replaceregexp file="${dist}/web/index.html" match="##keywords##" replace="${keywords}" flags="g" />
-
-
<replaceregexp file="${dist}/web/index.html" match="##tested:platform##" replace="${tested:platform}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##tested:processingVersion##" replace="${tested:processingVersion}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##tested:dependencies##" replace="${tested:dependencies}" flags="g" />
@@ -184,7 +171,6 @@
<replaceregexp file="${dist}/web/index.html" match="##source:url##" replace="${source:url}" flags="g" />
<replaceregexp file="${dist}/web/index.html" match="##source:repository##" replace="${source:repository}" flags="g" />
-
<echo>---------------------</echo>
<antcall target="processExamples" />
<echo>---------------------</echo>
@@ -193,10 +179,10 @@
<!-- finish organizating library's distribution -->
- <mkdir dir="${dist}/web/download" />
- <copy file="${dist}/${libraryName}_${versionNumber}.zip" todir="${dist}/web/download" />
+ <copy file="${dist}/${libraryName}.zip" todir="${dist}/web" />
+ <copy file="${dist}/${libraryName}_${library.version}.zip" todir="${dist}/web" />
- <copy todir="${processing}/${libraryName}/reference">
+ <copy todir="${processingLibraries}/patchy/reference">
<fileset dir="${reference}" />
</copy>
View
1  examples/HelloPatchy/HelloPatchy.pde
@@ -35,6 +35,7 @@ void setup()
scale = width / bounds.boundingSphereRadius();
cam = new PeasyCam(this, bounds.x.center() * scale, bounds.y.center() * scale
- 50, bounds.z.center() * scale, width);
+ cam.setMinimumDistance(width/2);
paper = loadImage("smallpaper.jpg");
dude = loadImage("gabeface.jpg");
}
View
0  hmm
No changes.
View
6 library.properties
@@ -0,0 +1,6 @@
+name = Patchy
+authorList = [Jonathan Feinberg](http://mrfeinberg.com/)
+url = http://mrfeinberg.com/patchy/
+category = 3D
+sentence = Patchy provides an easy-to-use bicubic patch for 3D Processing sketches.
+version = 100
View
62 src/patchy/readers/BPTReader.java
@@ -10,50 +10,50 @@
import patchy.Patchy;
import processing.core.PVector;
-public class BPTReader
-{
- public static PatchGroup read(final InputStream inputStream) throws IOException
- {
+public class BPTReader {
+ public static PatchGroup read(final InputStream inputStream)
+ throws IOException {
int line = 1;
- final BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
- try
- {
+ final BufferedReader in = new BufferedReader(new InputStreamReader(
+ inputStream));
+ try {
final int patchCount = Integer.parseInt(in.readLine());
line++;
final PatchGroup result = new PatchGroup();
- for (int i = 0; i < patchCount; i++)
- {
- final String[] dimensions = in.readLine().split("\\s+");
- if (dimensions.length != 2)
- {
- throw new RuntimeException("Expected patch dimensions at line "
- + line);
+ for (int i = 0; i < patchCount; i++) {
+ final String dimLine = in.readLine();
+ if (dimLine == null) {
+ throw new RuntimeException("Unexpected EOF");
}
- if (!(dimensions[0].equals("3") && dimensions[1].equals("3")))
- {
- throw new RuntimeException("I can only parse bicubic patches, not "
- + dimensions[0] + "," + dimensions[1]);
+ final String[] dimensions = dimLine.split("\\s+");
+ if (dimensions.length != 2) {
+ throw new RuntimeException(
+ "Expected patch dimensions at line " + line);
+ }
+ if (!(dimensions[0].equals("3") && dimensions[1].equals("3"))) {
+ throw new RuntimeException(
+ "I can only parse bicubic patches, not "
+ + dimensions[0] + "," + dimensions[1]);
}
final PVector[][] cp = new PVector[4][4];
- for (int x = 0; x < 4; x++)
- {
- for (int y = 0; y < 4; y++)
- {
- final String[] coords = in.readLine().split("\\s+");
- cp[x][y] = new PVector(Float.parseFloat(coords[0]), Float
- .parseFloat(coords[1]), Float.parseFloat(coords[2]));
+ for (int x = 0; x < 4; x++) {
+ for (int y = 0; y < 4; y++) {
+ final String coordline = in.readLine();
+ if (coordline == null) {
+ throw new RuntimeException("Unexpected EOF");
+ }
+ final String[] coords = coordline.split("\\s+");
+ cp[x][y] = new PVector(Float.parseFloat(coords[0]),
+ Float.parseFloat(coords[1]),
+ Float.parseFloat(coords[2]));
}
}
result.add(Patch.create(Patchy.BEZIER, cp));
}
return result;
- }
- catch (final NumberFormatException e)
- {
+ } catch (final NumberFormatException e) {
throw new RuntimeException(e + " on line " + line);
- }
- finally
- {
+ } finally {
in.close();
}
}
View
19 web/stylesheet.css
@@ -11,13 +11,10 @@
body {
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size : 100%;
- font-size : 0.70em;
font-weight : normal;
line-height : normal;
}
-
-
#container {
margin-left:64px;
background-color:#fff;
@@ -36,8 +33,6 @@ body {
}
-#demos { margin-bottom: 1.5em }
-
#about,
#download,
#examples,
@@ -65,12 +60,15 @@ body {
ul {
- list-style:none;
+ list-style:disc;
padding:0;
- margin:0;
+ margin: 0 0 1em 1em;
}
-
+#menu ul {
+ list-style:none;
+ margin: 0;
+}
#menu ul li, #subMenu ul li {
float:left;
padding-right:6px;
@@ -98,10 +96,9 @@ h2, h3, h4, h5, th {
p {
- font-size:1.1em;
+ font-size:1em;
width:90%;
- margin-bottom:2em;
- line-height: 130%;
+ margin-bottom:1em;
}

No commit comments for this range

Something went wrong with that request. Please try again.