PatchDataRep:
TYPE ~
RECORD [
cmd: Commander.Handle ¬ NIL,
tool: ImplicitDesign.Tool ¬ NIL,
primitives: PrimitiveList ¬ NIL
];
PatchCmd: Commander.CommandProc ~ {
args: CommanderOps.ArgumentVector ¬ CommanderOps.Parse[cmd];
p: PatchData ¬ NEW[PatchDataRep ¬ [cmd: cmd]];
s: IO.STREAM ¬ FS.StreamOpen["/mesa/ImpS/spolys" ! FS.Error => GOTO Bad];
IF args.argc = 3 THEN extent ¬ Convert.RealFromRope[args[2]];
DO
ENABLE IO.Error, IO.EndOfStream => EXIT;
x1: REAL ¬ IO.GetReal[s];
z1: REAL ¬ IO.GetReal[s];
y1: REAL ¬ IO.GetReal[s];
x2: REAL ¬ IO.GetReal[s];
z2: REAL ¬ IO.GetReal[s];
y2: REAL ¬ IO.GetReal[s];
x3: REAL ¬ IO.GetReal[s];
z3: REAL ¬ IO.GetReal[s];
y3: REAL ¬ IO.GetReal[s];
pts: TripleSequence ¬ TripleSequenceFromList[LIST[[x1, y1, z1], [x2, y2, z2], [x3, y3, z3]]];
p.primitives ¬ CONS[ImplicitConvolve.MakePrimitive[pts, extent,, intensity,,, res], p.primitives];
ENDLOOP;
IO.PutF[cmd.out, "%g primitives\n", IO.int[NPrimitives[p.primitives]]];
p.tool ¬ ImplicitConvolve.MakeTool[
cmd: cmd,
name: "PATCH IT!",
primitives: p.primitives,
clientData: p,
toolSettings: [trackSize: .02, threshold: 0.25]
];
G3dControl.UpdateControl[p.tool.renderTool.camera, p.tool.renderTool.camera.scale, 8.0];
EXITS Bad => RETURN[$Failure, "can't open file"];
};
ImplicitDesign.Register["Patch", PatchCmd, "\ta puffed-patch?", "ImplicitConvolve"];