Archive for category Uncategorized

Clover Seam Ripper Cap

Mary wanted a rigid cap for a Clover seam ripper that came with a small plastic sheath, so I called one from the vasty digital deep:

Clover Seam Ripper - new cap

Clover Seam Ripper – new cap

The solid model looks about like you’d expect, with a brim around the bottom to paste it on the platform:

Clover Seam Ripper Cap - Slic3r preview

Clover Seam Ripper Cap – Slic3r preview

I added a slightly tapered entry to work around the usual tolerance problems:

Clover Seam Ripper Cap - bottom view

Clover Seam Ripper Cap – bottom view

The taper comes from a hull wrapped around eight small spheres:

Clover Seam Ripper Cap - Entry Pyramid

Clover Seam Ripper Cap – Entry Pyramid

That’s surprisingly easy to accomplish, at least after you get used to this sort of thing:

hull() {																		// entry taper
	for (i=[-1,1] , j=[-1,1])
		translate([i*(HandleEntry[0]/2 - StemRadius),j*(HandleEntry[1]/2 - StemRadius),0])
			sphere(r=StemRadius,$fn=4*4);
	for (i=[-1,1] , j=[-1,1])
		translate([i*(HandleStem[0]/2 - StemRadius),j*(HandleStem[1]/2 - StemRadius),HandleEntry[2] - StemRadius])
			sphere(r=StemRadius,$fn=4*4);	
}

The side walls are two threads thick and, at least in PETG, entirely too rigid to slide on easily. I think a single-thread wall with a narrow ridge would provide more spring; if this one gets too annoying, I’ll try that.

The OpenSCAD source code as a GitHub gist:

Advertisements

,

7 Comments

WordPress Source Code Test Post, “Improved” Editor

This was created with the “improved” editor… to show WP support some of the problems I’m fighting on a regular basis.

So here’s a picture, just for fill:

Mood Light - thermocouple location

Mood Light – thermocouple location

It’s worth noting that you (well, I) cannot add this post text after that picture in Visual mode, because the “last character” is inside the picture caption: whatever I type appears in the caption. Switching to HTML mode, starting this sentence, then switching back to Visual mode, is the only way to go.

Here’s the same block of code, pasted in Visual mode:


void loop() {

MillisNow = millis();
if ((MillisNow - MillisThen) > UpdateMS) {
digitalWrite(PIN_HEARTBEAT,HIGH);

for (byte c=0; c < PIXELSIZE; c++) { // step to next increment in each color
if (++Pixels[c].Step >= Pixels[c].NumSteps) {
Pixels[c].Step = 0;
printf("Cycle %d steps %d at %8ld delta %ld ms\r\n",c,Pixels[c].NumSteps,MillisNow,(MillisNow - MillisThen));
}
}

for (int i=0; i < LEDSTRINGCOUNT; i++) { // for each layer
byte Value[PIXELSIZE];
for (byte c=0; c < PIXELSIZE; c++) { // ... for each color
Value[c] = StepColor(c,-i*Pixels[c].PlatterPhase); // figure new PWM value
// Value[c] = (c == RED && Value[c] == 0) ? Pixels[c].MaxPWM : Value[c]; // flash highlight for tracking
}
uint32_t UniColor = strip.Color(Value[RED],Value[GREEN],Value[BLUE]);
if (false && (i == 0))
printf("L: %d C: %08lx\r\n",i,UniColor);
for (int j=0; j < LEDSTRIPCOUNT; j++) { // fill layer with color
strip.setPixelColor(Map[i][j],UniColor);
}
}
strip.show();

MillisThen = MillisNow;
digitalWrite(PIN_HEARTBEAT,LOW);
}

}

The editor strips all the leading tabs and left-justifies all the lines. Tabs within the lines vanish, too, so all the comments slide leftward against the preceding code.

Here’s the same block, pasted in Visual mode with “Paste as text” turned on:


void loop() {

MillisNow = millis();
if ((MillisNow - MillisThen) > UpdateMS) {
digitalWrite(PIN_HEARTBEAT,HIGH);

for (byte c=0; c < PIXELSIZE; c++) { // step to next increment in each color
if (++Pixels[c].Step >= Pixels[c].NumSteps) {
Pixels[c].Step = 0;
printf("Cycle %d steps %d at %8ld delta %ld ms\r\n",c,Pixels[c].NumSteps,MillisNow,(MillisNow - MillisThen));
}
}

for (int i=0; i < LEDSTRINGCOUNT; i++) { // for each layer
byte Value[PIXELSIZE];
for (byte c=0; c < PIXELSIZE; c++) { // ... for each color
Value[c] = StepColor(c,-i*Pixels[c].PlatterPhase); // figure new PWM value
// Value[c] = (c == RED && Value[c] == 0) ? Pixels[c].MaxPWM : Value[c]; // flash highlight for tracking
}
uint32_t UniColor = strip.Color(Value[RED],Value[GREEN],Value[BLUE]);
if (false && (i == 0))
printf("L: %d C: %08lx\r\n",i,UniColor);
for (int j=0; j < LEDSTRIPCOUNT; j++) { // fill layer with color
strip.setPixelColor(Map[i][j],UniColor);
}
}
strip.show();

MillisThen = MillisNow;
digitalWrite(PIN_HEARTBEAT,LOW);
}

}

Obviously, that had no effect whatsoever: all the tabs vanish.

Here’s the same block, pasted in HTML mode:

void loop() {

MillisNow = millis();
if ((MillisNow - MillisThen) > UpdateMS) {
digitalWrite(PIN_HEARTBEAT,HIGH);

for (byte c=0; c < PIXELSIZE; c++) { // step to next increment in each color if (++Pixels[c].Step >= Pixels[c].NumSteps) {
Pixels[c].Step = 0;
printf("Cycle %d steps %d at %8ld delta %ld ms\r\n",c,Pixels[c].NumSteps,MillisNow,(MillisNow - MillisThen));
}
}

for (int i=0; i < LEDSTRINGCOUNT; i++) { // for each layer
byte Value[PIXELSIZE];
for (byte c=0; c < PIXELSIZE; c++) { // ... for each color
Value[c] = StepColor(c,-i*Pixels[c].PlatterPhase); // figure new PWM value
// Value[c] = (c == RED && Value[c] == 0) ? Pixels[c].MaxPWM : Value[c]; // flash highlight for tracking
}
uint32_t UniColor = strip.Color(Value[RED],Value[GREEN],Value[BLUE]);
if (false && (i == 0))
printf("L: %d C: %08lx\r\n",i,UniColor);
for (int j=0; j < LEDSTRIPCOUNT; j++) { // fill layer with color
strip.setPixelColor(Map[i][j],UniColor);
}
}
strip.show();

MillisThen = MillisNow;
digitalWrite(PIN_HEARTBEAT,LOW);
}

}

When pasted, that looked correct, but switching back to Visual mode, even without doing any editing, stripped out all the tabs again.

Oh, and something is escaping the ampersand characters over and over again.

So, obviously, nobody has ever tested the “improved” editor against source code blocks.

Incidentally, the Visual and HTML tabs scroll off the top, but pressing Ctrl-Home scrolls only within this narrow text window. Scrolling to the top requires mouse manipulation: click outside the text column, then whack Ctrl-Home. All that, just to switch modes.

7 Comments

WordPress Source Code Test Post: Old Editor

A test post to show WP support the problem with source code I’m fighting…

I created this using the “old” editor, then went back to the Posts listing and edited it with that editor. It’s worth noting that the “Edit” link in the post preview triggers the “improved” editor, which shreds existing sourcecode blocks.

One of the many pictures I use that are easiest to handle using the Visual editor, which is why I’m pushing back so hard against any workaround that involves not switching editor modes:

Mood Light - thermocouple location

Mood Light – thermocouple location

I create code blocks by typing (or pasting) the opening & closing sourcecode tags, then copying the block from the text editor and pasting it between the tags. No MS Word, no word processing, no exotic formats, just plain text from a programming editor.

A chunk of code that I pasted in Text mode, then switched to Visual mode to insert the picture above:

void loop() {
	
	MillisNow = millis();
	if ((MillisNow - MillisThen) > UpdateMS) {
		digitalWrite(PIN_HEARTBEAT,HIGH);
		
		for (byte c=0; c < PIXELSIZE; c++) { // step to next increment in each color if (++Pixels[c].Step >= Pixels[c].NumSteps) {
				Pixels[c].Step = 0;
				printf("Cycle %d steps %d at %8ld delta %ld ms\r\n",c,Pixels[c].NumSteps,MillisNow,(MillisNow - MillisThen));
			}
		}

		for (int i=0; i < LEDSTRINGCOUNT; i++) {				// for each layer
			byte Value[PIXELSIZE];
			for (byte c=0; c < PIXELSIZE; c++) {				//  ... for each color
				Value[c] = StepColor(c,-i*Pixels[c].PlatterPhase);		// figure new PWM value
//				Value[c] = (c == RED && Value[c] == 0) ? Pixels[c].MaxPWM : Value[c];	// flash highlight for tracking
			}
			uint32_t UniColor = strip.Color(Value[RED],Value[GREEN],Value[BLUE]);
			if (false && (i == 0))
				printf("L: %d C: %08lx\r\n",i,UniColor);
			for (int j=0; j < LEDSTRIPCOUNT; j++) {				// fill layer with color
				strip.setPixelColor(Map[i][j],UniColor);
			}
		}
		strip.show();

		MillisThen = MillisNow;
		digitalWrite(PIN_HEARTBEAT,LOW);
	}
	
}

All the “greater than”, “less than”, and “ampersand” characters have been HTML-escaped and will now stay that way forever.

Part of that problem may be that the editor sometimes inserts a bogus end tag for a Preformatted block that doesn’t match an opening tag, typically at the bottom of the post. That seems to happen only when the source code block is the last text in the post; it’s as if the editor puts pre tags around the block as some part of round-tripping the source code, but loses track when it removes them.

It will also insert spurious nbsp escaped characters in blank lines that seem to affect the outcome.

Here’s the same block, inserted in Visual mode with “Paste as text” turned off:

void loop() {
 
 MillisNow = millis();
 if ((MillisNow - MillisThen) > UpdateMS) {
 digitalWrite(PIN_HEARTBEAT,HIGH);
 
 for (byte c=0; c < PIXELSIZE; c++) { // step to next increment in each color if (++Pixels[c].Step >= Pixels[c].NumSteps) {
 Pixels[c].Step = 0;
 printf("Cycle %d steps %d at %8ld delta %ld ms\r\n",c,Pixels[c].NumSteps,MillisNow,(MillisNow - MillisThen));
 }
 }

 for (int i=0; i < LEDSTRINGCOUNT; i++) { // for each layer
 byte Value[PIXELSIZE];
 for (byte c=0; c < PIXELSIZE; c++) { // ... for each color
 Value[c] = StepColor(c,-i*Pixels[c].PlatterPhase); // figure new PWM value
// Value[c] = (c == RED && Value[c] == 0) ? Pixels[c].MaxPWM : Value[c]; // flash highlight for tracking
 }
 uint32_t UniColor = strip.Color(Value[RED],Value[GREEN],Value[BLUE]);
 if (false && (i == 0))
 printf("L: %d C: %08lx\r\n",i,UniColor);
 for (int j=0; j < LEDSTRIPCOUNT; j++) { // fill layer with color
 strip.setPixelColor(Map[i][j],UniColor);
 }
 }
 strip.show();

 MillisThen = MillisNow;
 digitalWrite(PIN_HEARTBEAT,LOW);
 }
 
}

The editor converts all the leading tabs into a single space character, shredding the layout. If that were Python, it would shred the syntax as well.

Here’s the same block of text, inserted in Visual mode with “Paste as text” turned on:

void loop() {
 
 MillisNow = millis();
 if ((MillisNow - MillisThen) > UpdateMS) {
 digitalWrite(PIN_HEARTBEAT,HIGH);
 
 for (byte c=0; c < PIXELSIZE; c++) { // step to next increment in each color if (++Pixels[c].Step >= Pixels[c].NumSteps) {
 Pixels[c].Step = 0;
 printf("Cycle %d steps %d at %8ld delta %ld ms\r\n",c,Pixels[c].NumSteps,MillisNow,(MillisNow - MillisThen));
 }
 }

 for (int i=0; i < LEDSTRINGCOUNT; i++) { // for each layer
 byte Value[PIXELSIZE];
 for (byte c=0; c < PIXELSIZE; c++) { // ... for each color
 Value[c] = StepColor(c,-i*Pixels[c].PlatterPhase); // figure new PWM value
// Value[c] = (c == RED && Value[c] == 0) ? Pixels[c].MaxPWM : Value[c]; // flash highlight for tracking
 }
 uint32_t UniColor = strip.Color(Value[RED],Value[GREEN],Value[BLUE]);
 if (false && (i == 0))
 printf("L: %d C: %08lx\r\n",i,UniColor);
 for (int j=0; j < LEDSTRIPCOUNT; j++) { // fill layer with color
 strip.setPixelColor(Map[i][j],UniColor);
 }
 }
 strip.show();

 MillisThen = MillisNow;
 digitalWrite(PIN_HEARTBEAT,LOW);
 }
 
}

Pretty much the same thing: consecutive tabs become a single space.

For whatever it’s worth, I’ve removed a bogus pre closing tag from the bottom of the post three times by now…

Keeping some text at the bottom seems to prevent the bogus pre tag, but that’s hard to enforce…

Leave a comment