Freesteel Blog » 2008 » February

Thursday, February 28th, 2008 at 11:33 am - - Machining 1 Comment »

I spent over a week on a report that the Z-slicing was too slow. In particular it was five times slower than Machining Strategist. As I’d authored the code in that product back in 1994, and there was no evidence of substantial change, this wasn’t good enough.

Here is a Z-slice of a wobbly test surface.

Performance seemed okay when we first looked at it. The problem was most acute for very small tool diameters. A common function the Danes like to use in their machining algorithms is Silhouette Boundary. For this we define a very tall tool with a tiny diameter and ask for a Z-slice at height below the lowest point of the model. The tool only touches on its shaft and the result is exactly the shadow of the entire model, offset outwards by the shaft radius. You can offset this contour inwards to reach the desired result.

The silhouette boundary is used in HSMWorks to limit the extent of parallel passes machining. I can’t see the point of this, because it means you don’t machine the extent of the surface depending on its slope at the edge. For example, consider the convex hemisphere. The silhouette is a circle. Machining with a ballnosed tool whose central axis constrained by this boundary means you miss the edge by slightly less than the radius of the tool. If you want to machine all the way to the lower rim you have to offset the silhouette outwards by the tool radius, and then the boundary constraints will put the tool right on the limit at the tangent point of falling off the edge.

This is where it gets nasty.

Because the cut-off contour is on the exact margin where the tool drops off the model, half the points will fall off, and half the points will stay on. That’s the nature of using a curve along a line of discontinuity, and it has nothing to do with the precision; it would still happen if you were splitting electrons. If the Z-low plane is some distance below the split line of the model, then this boundary will produce a horrible zig-zag mess of toolpath ends at the edge. The best way to clean this up is to discard all line segments where one end makes contact with the Z-low base plane.

This works, and the beautiful thing is that the “clean-up” stage is so effective that you don’t need the silhouette boundary in the first place! All you need are parallel passes within a bounding box, and then you discard all toolpath motions that are in contact with the base plane to give a result that is as-if you trimmed it to a tool-radius offset silhouette boundary, only better.

The best way to fix something is to argue that it doesn’t need to be fixed.

This didn’t wash. They also use these boundaries for constant scallop machining. I had to look harder.

The Z-slice function is based on the creation of a slice for one triangle at a time, and using an area model that can very quickly find the union between these single triangle slices. This merges to create the contour for the whole part. In Machining Strategist I did it for a whole triangle at a time, which meant that there were duplicate calculations for these single triangle contours according their shared edges and points. In HSMWorks I tried to optimize out this duplication by separating the triangle into its seven components (1 facet, 3 edges, 3 points). However, by applying the facets last after the edges and points, I created an intermediate stage where the area model was highly fragmented (and therefore slow) before all the triangular holes were filled in. This was particularly bad when the tool diameter was smaller than the average triangle and could fall through.

Simple answer: rearrange the code to change the order of the parts.

It improved it a bit, but still didn’t make it fast enough.

After a few more days looking at it I found that someone had altered the size of the bucketing of the surface. The bucketing is important so that for each component of the area model (it’s composed of fibres, as seen in the skeleton model below) you don’t need to apply all the triangle components from the whole model, but just the ones in the local area.

This stage, which I think is known as “preparing the surface” in the HSMWorks task manager, was taking too long to execute, so someone had widened its resolution to “speed it up”. This wasn’t very helpful because it slowed everything else down, including my Z-slicing routine.

Well, at least that got to the bottom of that. There is an optimal value for the bucket width so that the sum of the time to generate the buckets and the time for the Z-slice is minimized — and it had been set far from optimal.

This then becomes another thing on the list to look at first when I get the next complaint that it is not running fast enough.

Theoretically, the algorithm should be running faster than the version in Machining Strategist because it is the same but more developed. In practice I don’t know, and I am not very interested.

Generally, the programmer only hears about it when the code is running more slowly than the rivals; nobody bothers to mention it when it is running much faster. In this world, when a programmer does produce something significantly faster because they immediately get used to it. Instead it’ll be the programmers in the other companies who will get hassled about it, while the guy responsible for producing something efficient has no idea of the grief he has caused.

That is, until he quits and works for one of those rival firms and his earlier work is used as a stick to beat him.

Wednesday, February 27th, 2008 at 12:19 am - - Kayak Dive, Machining, Weekends 1 Comment »

Things falling behind here. With all these distractions like seeing a public inquiry and expanding wikipedia articles such as SS Castilian as I have just taken order of Volume 2 of the best dive guide ever (coz it covers my local area). Only thing wrong with it is there’s no kayak diving.

I have to try to do less with wikipedia. It must be those marine wrecks which caused me to find the
UNESCO Convention on the Protection of the Underwater Cultural Heritage
(not signed by the UK). Anyway, it has to stop. Not even when attracted by a page with the title Middle Mouse.

I’ve got lots of serious HSMWorks bugs piling up which need sorting out NOW! Too many days lost on the constant scallop again. I discovered better ways to choose the place to subdivide the cells. Many issues disappeared, I hope.

Wednesday, February 27th, 2008 at 12:06 am - - Whipping

Over a week ago I spent 3 days down in Reading at the Green Party spring conference. Never been to a party conference before. I went as an observer trying to push my vote quiz idea,[1] and getting the usual “too busy” answer from most people. When the seagrass server started working again, I tested it on a few people. No one clicked on the links, sadly.

I had printed out my political widget on a piece of paper,[2] and was glad to see that everyone got it. The need to nominate two specific votes could provide the push for getting people to look more deeply at divisions and to ask questions. The no2id stand also understood the potential. As usual, people are short on encouragement; and simply think about themselves and how much work it’ll take for them to make it functional, rather than acknowledging how far I have had to bring it to get it here.

The plenary sessions of the Green Party were very structured, running through a tight schedule of motions almost Parliamentary democracy style (but without the whipping) where everything was subject to a general vote. Attendees were given a 60 page document containing amendments to the Manifesto for a Sustainable Society,[3] Deleting and replacing numbered paragraphs from this constituted the majority of business.

In spite of this, there were no actual copies of the manifesto document that was being amended floating around. I found this really peculiar. Usually the excuse was it was the size of a telephone book. The MfSS appears to be a unique feature of the Green Party in that they work with a continually updated and very detailed manifesto which has evolved over the decades. We’re used to the other parties simply throwing a few pages together a week before the election where it contains as much content and BS as a corporate annual report, but without the accounts.

There were workshop meetings about these amendments which I didn’t go to. Everything else is a “fringe” meeting. A couple were easy to remember. I watched a talk on how to write a press release, by their new press officer — he’s just moved down from being a press officer at the Scottish Parliament. There were some interesting lessons.

There was a talk about designing local websites. The speaker gave a general whinge about how all of them are broken/out of date! Go and click on the links on this page.[4] I raised the point that it only takes one lowly member of the party to appoint themselves as quality control and go through them all once a month (it would take about an evening) and start prodding the local groups, which would do them a favour; but no one followed it. So much for self-directed work.

Most members were beardies with cardigans, but there were a handful of young men in suits who seemed to be taking control of things. Things are gearing up to get Caroline Lucas into Parliament in Brighton.

It was one of them (Cath) whom I knobbled to try and talk about all things mySociety related. During Lucas’s presentation she mentioned about the systematic lobby corruption in the EU Parliament, and how the Green Group was intending to hire someone to match all the proposers of amendments according to MEPs and their interests to document how the changes are being siphoned in by the corporations. Clearly this is a job for one of our computer systems, so I was inquiring further. My points were not obvious.

The EU parliament webpages are still a disaster area for me. Cath said the place that some of the structure can be found is at the Legislative Observatory.[5]

I’m still not convinced. On Saturday afternoon Lucas launched her new website,[6] and I missed the wine and chocolate because I was still gabbing to the no2id guys. I’d been looking at it all day to change, but it already had done. Apparently there are links through to the EU parl happenings of what she does, but still pretty impenetrable. There are official MEP pages with some stuff.[7] Someone else can decide in what way these are deficient compared to the theyworkforyou MP pages.

One obvious thing springs to mind is the fact that committee memberships in the EU are crucial for who is doing what. If these committee positions were scraped from these membership pages and presented on the writetothem list of your 10 MEPs, then you would know exactly which one to write to about any particular issue.

[2] wpblog/introducing-a-political-widget/

Thursday, February 21st, 2008 at 5:52 pm - - Whipping

And so we come to a day three years after Mr Christopher Ames wrote a letter to the Foreign Office which said:

“I would like to make a request under the Freedom of Information Act to see a draft of the September Dossier on ‘Iraq’s Weapons of Mass Destruction’ which according to John Scarlett, was produced by John Williams. It was referred to in an e-mail from Daniel Pruce as ‘John’s draft of [9 September 2002]'”.[1]

After much legal wrangling and fighting, the Foreign Secretary complied with the law concerning the public’s right to know the full details by which the Government lied this country into war with Iraq, and released the document,[2] stating:

The document produced by John Williams, then head of the FCO’s press office, was not commissioned as part of the formal drafting process and was not used as the basis for the dossier the Government subsequently published, which was produced by the Joint Intelligence Committee.[3]

The Information Tribunal prints part of Daniel Pruce’s 10 September email:

“I promised some quick thoughts on John’s draft of 9 September… we also need to think, once we have John’s further draft tomorrow, how we prepare the ground for the launch of the text to get expectations in the right place”

I can’t account for the fact we’ve got a 22 July draft rather than a 9 September draft, although the Information Commissioner provides a detailed chronology of the events leading up to his possession of this document in December 2005 after overcoming the arguments that it was too embarrassing sensitive to release it to him, even though he had all the necessary security clearance.[4]

Regardless of its version, it is a shockingly bad piece of work in every way. It’s clearly an attempt to produce a sales-pitch for a military invasion, rather than an early collection of notes that will later be assembled into something coherent and complete. Here’s its first paragraph:

“Iraq presents a uniquely dangerous threat to the world. No other country has twice launched wars of aggression against neighbours. In the 77 years since the Geneva Convention against chemical weapons was signed, Iraq is the only country to have broken it. Saddam Hussein is not the world’s only dictator, but no other has used poison gas against civilians. No other country has flouted the United nations’ authority so brazenly in pursuit of weapons of mass destruction.”

This was too much for the next person who scrawled some notes on the page. They pointed the words “Germany?” and “US – Cuba, Grenada” at the second sentence, and suggested inserting “since WWII” at the end of that line.

Also, realizing that 77 years before 2003 sets the date back to 1926, they added the question “Japan in China?” A lot of bad things happened since 1926, such as the Changde chemical weapon attack, not to mention the massive use of Agent Orange and Napalm during the Vietnam War, which one has to be pathologically narrow-minded not to classify as Chemical Weapons, seeing as they are both extremely reactive Chemicals that are used as Weapons.

But that’s not all. The person writing the notes also added one word, “Israel”, beside the sentence alleging that: “no other country [apart from Iraq] has flouted the United Nations’ authority so brazenly in pursuit of weapons of mass destruction.”

As any fool knows, Israel has flouted every authority in its pursuit and possession of nuclear weapons. However, this one word had to be wiped out from the margin, because the Government official argued that the note indicated that the person who wrote it believed that Israel has flouted the United Nations’ authority in a manner similar to that of the Iraqi regime of Saddam Hussein, and that this would seriously damage the UK’s relations with Israel, because the comparison with Saddam and the implied accusation of a breach of the UN’s authority by Israel are potentially very serious.[5]

Now, what I don’t get with all of this — and I think this goes very deep into the psychological mechanics of an official state lie — is: Why does it make any difference that that note got erased? We know it was there. We know it is true. Yet somehow not actually seeing that pencil mark as hard evidence contradicting the idea that not one single person in the entire Government is aware of the truth makes a difference to their ability to sustain the fantasy that they actually give a damn about international law. The fact is, the Government clearly demonstrates that it doesn’t care about international law by its covering up of the Israeli nuclear weapons program, and even though this is done in broad daylight out in the open, the cover-up for some unknown reason succeeds. If it didn’t, then whenever the UK Government censured another country for it’s non-compliance with international law regarding nuclear weapons, everyone would fall over laughing. It is not competent to make a case.

Thursday, February 14th, 2008 at 8:34 am - - UN, Whipping 3 Comments »

Have refrained from doing Wikipedia and UN for a while. Last night I accidentally got onto it and have just lost several hours.

I was pleased to find something which sorts out the rather stringent and obviously counter-productive all rights reserved copyright issue regarding the United Nations documents. It was found in Template:PD-UN, which refers to Administrative Instruction ST/AI/189/Add.9/Rev.2 on wikisource.

I immediately scraped it into ST-AI-189-Add.9-Rev.2 on undemocracy so you can see it in its full shambolic reproduction.

I don’t know what geniuses found out about it or transcribed it. Actually I do; they are credited in the history page in wikisource, although it doesn’t explain it.

JesseW wrote the comment: “(clarify status of this instruction — /Add.2 extended it without a expiration date, and I just checked that it’s in force in the most recent (2007) index.)”

So I scraped ST-AI-189-Add.9-Rev.2-Add.2 into undemocracy.

Now you wouldn’t have thought that a recursively extended and obscurely labeled document would be of any importance a few years on, but this one is, because back in 1985 the Revision 2 of Addendum 9 on the 189th Administrative Instruction by the Secretariat said:

The present instruction revises, on an experimental basis until the end of 1989, the Organization’s policy towards copyrighting as set forth in administrative instruction ST/AI/189/Add.9/Rev.1 of 26 March 1985.

1/ That policy was, in essence, not to seek copyright with the intention of thus facilitating dissemination as widely as possible of the ideas in United Nations publications. However, numerous exceptions to that policy were made over the years as it became clear that there was a need to retain control over certain United Nations materials to ensure that they were used in the best interests of the Organization, or to protect the revenues that might accrue from sales publications and that would be adversely affected by unauthorized, competitive commercial publication.

2. The following categories of material will, as at present, be left in the public domain, i.e., the United Nations will not seek copyright therefor unless, prior to issue and in exceptional circumstances, the Publications Board decides otherwise, in consultation with the Office of Legal Affairs.

(a) Official Records: a series of printed publications relating to the proceedings of organs or conferences of the United Nations. They include verbatim or summary records, documents or check-lists of documents, issued in the form of annexes to those records, including periodic supplements, such as the quarterly ones of the Security Council; and reports to those organs of their subordinate or affiliated bodies, compilations of resolutions, certain reports of the Secretary-General and other selected publications, which are issued in the form of supplements;

(b) United Nations documents: written material officially issued under a United Nations document symbol, regardless of the form of production, although, in practice, the term is applied mainly to material offset from typescript and issued under a masthead. The term also applies to written material issued simultaneously or sequentially in the form of documents and publications;

(c) Public information material: publications, periodicals, brochures, pamphlets, press releases, flyers, catalogues and other materials designed primarily to inform about United Nations activities. For the purposes of this instruction the term does not include public information that is offered for sale, which may be subject to copyright registration.

There follows a lot of details of the procedures to keep something in copyright if you absolutely have to.

Well, that’s sorted it out at least, up until 1989. However, as JesseW noticed, Addendum 2 of Revision 2 on Addendum 9 etc (known as ST/AI/189/Add.9/Rev.2/Add.2) says:

There is a general consensus that the revised copyright policy has had a positive impact and yielded the desired result of enhancing the control the Organization retains over the use of its intellectual property to ensure that it is used in the best interests of the United Nations and to protect the revenues that might accrue from sales and external publications. However, it is apparent that greater efforts are required by author departments at all duty stations to adhere to and apply uniformly the copyright policy and procedures announced in ST/AI/189/Add.9/Rev.2. It is equally apparent that issues pertaining to the copyright of designs originating within the Organization as well as the copyrightability and possible revisions to the guidelines set out in administrative instruction ST/AI/189/Add.9/Rev.2. The purpose of the present instruction is to extend the experimental period until these issues have been resolved in a further revision to that instruction.

I scraped for both ST/AI/189/Add.9/Rev.2/Add.3 and ST/AI/189/Add.9/Rev.3 and neither exist, so I guess he may be right in that we are still, 20 years later, experiencing the experimental period.

I think that all of life is an experimental period, so it’s good to hear that someone else sees it that way too.

Tuesday, February 12th, 2008 at 2:02 pm - - Whipping 4 Comments »

Having known of Brian Haw for some time, and even got a poster onto his display and subsequently into the Tate,[1] I’ve been following the progress of the legislation to ban protest in Parliament.[2]

The first draft of this legislation would have made someone who “spoil[ed] the visual aspect, or otherwise spoil[ed] the enjoyment by members of the public, of any part of the designated area” liable for arrest.[3] According to David Heath MP, this would have meant that “a constable can decide that somebody looks untidy in Parliament square. Furthermore, on that basis they can apply an order with the force of law that excludes that person not just from Parliament square but from a radius of 1 km around Parliament square.”

A hurried rewrite of the law gave us what we have today,[4] which has still led to a lot of arrests[5] and nonsense.[6] Owing to the increasingly evident authoritarian stupidity of this law,[7] the new Prime Minister announced that it was going to be reviewed as soon as he came into office.[8] The public consultation for this review closed on 17 January 2008.[9]

Unfortunately, the documentation (Command Paper 7235) provided to the public for the consultation was so bad it took me a long time to realize that something could be done about it. You’d think that if the Home Secretary wrote: “We need to review sections 132-138 of the Serious Organised Crime and Police Act 2005 soberly. We need to focus on what the legislation actually does…,” then somewhere in the next 30 pages it would bother to mention how many arrests and notifications to hold demonstrations had been made under the Act during the brief two years it had been in operation.

Look, you are holding this “review” because there have been problems! Tell us what is the scale of the problems!

Instead of mentioning any the supposed problems, and raising for consideration the simple and popular measure of just repealing the law that no one needs and no one wants, the Home Office consultation document suggested that the issue was partly a lack of harmonisation with the right to protest elsewhere and posing needlessly leading questions, such as:

Q7: Do you agree that conditions in order to prevent a security risk of hindrance to the operation of Parliament should remain in relation to demonstrations in the vicinity of Parliament?

while neglecting to mention that there have been numerous laws in operation prior to August 2005 covering the security and the functioning of Parliament during across centuries of democratic democratic without such a ridiculous restrictions to demonstration, which this law has nothing to do with. The sole point of this law was to remove Brian Haw.[10] He wasn’t removed.[11] Can we just have our rights back?

At the very least, we should have the information. On 7 January 2008 I filed an FOI request, which said:[12]

Dear Sir or Madam,

I have recently read the 31 page consultation document titled: “Managing Protest Around Parliament” detailing a review of sections 132-138 of the Serious Organised Crime and Police Act 2005.

This document fails to make any mention of the high-profile incidents relating to these sections, including a variety of arrests and judicial actions.

I am therefore requesting a copy of–

* all statistics relating to the written notices to the Commissioner under section 133,

* all statistics relating to the authorisations given by the Commissioner under section 134, and

* all reports relating to arrests, prosecutions, and other judicial actions for offences under these sections;

that are available to the Public Order Unit of the Home Office which is overseeing the process of review.

Yours etc.

Scroll down on the FOI request page to find the 34 pages they sent back, which I scanned and uploaded onto the web. Mark Thomas’s Mass Lone Demonstration on 20 December 2006 takes up four pages. I’ve put in a follow-up for the 2007 data, which appears missing. Other than that, it’s all there, with all its silliness. Someone who is keeping track of the arrests[13] should be able to cross reference with the data that is there now.

I’d also like to know if anyone is similarly outraged at the quality of the consultation document, which I think is worse than any of those produced by the Government when it was trying to push GM food down our throats. There are supposedly standards to these consultation exercises.[14] If this document doesn’t breach those guidelines, then the guidelines themselves aren’t good enough.

Any consultation about a change in the law must include a fair summary of how the current law that there are proposals to change has actually been applied.

This month the new Parliamentary Under-Secretary for Security and Counter-terrorism, Admiral Alan William John West, Baron West of Spithead, reported that there had been 500 or so responses to this consultation.[15] During the discussion, the military politician added:

I have some experience of the demonstration there. Before I joined the House, I was in full uniform in my car and the demonstrator came up and accused me of being a fascist warmonger. I think I proved that I was a peacemaker because my Royal Marine colour sergeant who was driving me said, “Shall I put him straight, sir?”, and I said, “No, just remain sitting where you are”.

After all, when you have “Parliamentary sovereignty” and “the rule of law” on your side, there are better ways for an Admiral to cleanse the streets of unsightly displays of anti-militarism than allowing his chauffeur to create an embarrassing scene in public.

As to whether he really is a “fascist warmonger”, we would have to discuss the nature of his visits “on the ground in Iraq a number of times over the past four years,”[16] for if they were for tourism or to visit friends and family in Basra, that would be fine. But if it was in his capacity as a commanding officer during a brutal military occupation[17] following an unprovoked invasion of a foreign country the UK has absolutely no business being in,[18] then the facts are unequivocal.


Sunday, February 10th, 2008 at 12:30 am - - Whipping 3 Comments »

I am registered to vote in Brighton, Kemptown.
Across all issues, my MP, Desmond Turner, votes in line with my principles 46% of the time.
I support his vote against Trident Replacement on 14 March 2007.
I condemn his vote in favour of a Parliamentary exemption from the Freedom of Information Act on 18 May 2007.

Exhibited on the right: a proposal for a personalized mySociety style widget for tracking your MP in relation to your opinion, featuring relevant links to and

All it needs to know is your constituency and your principles on a series of issues. A dynamic interface for selecting these measures can be tried out here. For now, it’s hard-coded for one constituency (Brighton, Kemptown) where the names of the alternative candidates for the next election are known. (For now, this page is being used to illustrate the need pressing need for data to be supplied by parties who do not have any MPs.)

The lower part of the box picks out two votes, one that I agree with, and one that I oppose, that have been cast by my MP in Parliament. It’s important to reach beyond the generalities to individual votes on something specific in order to make clear that words and promises are not enough, because these votes represent the definitive action. An interface for selecting these votes from the hundreds that are cast in any year is yet to be designed, but the system can make a good guess by comparing the opinions of the user and the votes by the MP.

This personalized widget could show up in several different forms. The voting behavior link could be turned off if the user does not want to disclose their views to other people. Or it could be seen. It could invite other users to make their own box. It could communicate via the server to register the voting opinions of everyone in a constituency so that you could find out what other people think and see how out of line the MP’s opinion is in relation to it.

What makes it different from most electoral widgets is that if you notify that you intend to vote for or against a possible candidate, it can explain why. It creates the possibility for unbundled polling data. It gets at the opinions on the issues that an MP is asked to decide, rather than opinions about who is “best for the job”.

A widget of this kind should exist at some point somewhere. There is nothing simpler that could be meaningful. We have the data. We have a prototypical interface. We need to hear from someone who knows about widgets.

Oh, and the percentage weight would be dynamic as more votes are cast during the Parliamentary term, so you can check on it whenever you like, not just at the election. The choice of good and bad votes is another way to find people who should be working together to pressure or reward their MP for their behavior in Parliament.